diff --git a/packages/app/src/Element/SendSats.tsx b/packages/app/src/Element/SendSats.tsx index f27e761..bc10747 100644 --- a/packages/app/src/Element/SendSats.tsx +++ b/packages/app/src/Element/SendSats.tsx @@ -93,6 +93,7 @@ export default function LNURLTip(props: LNURLTipProps) { const [error, setError] = useState(); const [success, setSuccess] = useState(); const [zapType, setZapType] = useState(ZapType.PublicZap); + const [paying, setPaying] = useState(false); const webln = useWebln(show); const { formatMessage } = useIntl(); const publisher = useEventPublisher(); @@ -239,6 +240,7 @@ export default function LNURLTip(props: LNURLTipProps) { async function payWebLNIfEnabled(invoice: LNURLInvoice) { try { if (webln?.enabled) { + setPaying(true); const res = await webln.sendPayment(invoice?.pr ?? ""); console.log(res); setSuccess(invoice?.successAction ?? {}); @@ -248,6 +250,8 @@ export default function LNURLTip(props: LNURLTipProps) { if (e instanceof Error) { setError(e.toString()); } + } finally { + setPaying(false); } } @@ -331,7 +335,14 @@ export default function LNURLTip(props: LNURLTipProps) { <>
{props.notice && {props.notice}} - + {paying ? ( +

+ + ... +

+ ) : ( + + )}
{pr && ( <> diff --git a/packages/app/src/lang.json b/packages/app/src/lang.json index cfe50d4..bbb757f 100644 --- a/packages/app/src/lang.json +++ b/packages/app/src/lang.json @@ -608,6 +608,9 @@ "lD3+8a": { "defaultMessage": "Pay" }, + "lSpQet": { + "defaultMessage": "Paying with WebLN" + }, "lgg1KN": { "defaultMessage": "account page" }, @@ -676,6 +679,9 @@ "pzTOmv": { "defaultMessage": "Followers" }, + "qMx1sA": { + "defaultMessage": "Default Zap amount" + }, "qUJTsT": { "defaultMessage": "Blocked" }, diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index 148a085..6cd47eb 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -198,6 +198,7 @@ "k7sKNy": "Our very own NIP-05 verification service, help support the development of this site and get a shiny special badge on our site!", "lCILNz": "Buy Now", "lD3+8a": "Pay", + "lSpQet": "Paying with WebLN", "lgg1KN": "account page", "ll3xBp": "Image proxy service", "lnaT9F": "Following {n}", @@ -220,6 +221,7 @@ "oxCa4R": "Getting an identifier helps confirm the real you to people who know you. Many people can have a username @jack, but there is only one jack@cash.app.", "puLNUJ": "Pin", "pzTOmv": "Followers", + "qMx1sA": "Default Zap amount", "qUJTsT": "Blocked", "qdGuQo": "Your Private Key Is (do not share this with anyone)", "qkvYUb": "Add to Profile",