From 2e98fba55d572186f39d00235db1024791ba1561 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 21 Sep 2026 19:41:37 -0700 Subject: send: stop the Max buttons from cancelling their own submit, show LNURL action errors Choosing Max on the LNURL-pay page left the button spinning forever. Two things combined: The Max buttons set `loading` from their click handler. Svelte flushes `disabled={loading}` to the DOM before the browser runs the button's submit activation, and a disabled button submits nothing. Set loading from the form's onsubmit instead, the way the Send button always did. The /ln page never passed `form` into the Lnurlp and Lnurlw components, so any action failure (pay, max or withdraw) rendered nothing and never reset the spinner. Pass it through, and reset loading when a result arrives. Verified in headless Chrome against the dev stack: the bolt11 Max lands on the fee view, and the LNURL Max surfaces the server's error and re-enables the buttons. Co-Authored-By: Claude Fable 5.1 --- src/components/Lnurlp.svelte | 9 +++++++-- src/routes/(app)/ln/[lnurl]/+page.svelte | 8 +++++--- .../(app)/send/lightning/[payreq]/[...memo]/+page.svelte | 11 +++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte index 2b715667..c1ae0c95 100644 --- a/src/components/Lnurlp.svelte +++ b/src/components/Lnurlp.svelte @@ -17,6 +17,8 @@ let amount = $state(Math.round(minSendable / 1000)), loading = $state(); let submit = () => (loading = true); + // An action result (an error, since success redirects) ends the wait + $effect(() => form && (loading = false));
@@ -60,12 +62,15 @@
{#if max >= Math.round(minSendable / 1000)} + Max ⚡️{s(max)} {/if}