diff options
| author | Adam Soltys <[email protected]> | 2026-10-02 07:10:15 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-02 07:10:15 -0700 |
| commit | c890225add1f5e88595f6ae9ce2a0a9d07d5f050 (patch) | |
| tree | e264ae87cbdf6cc92851f6c63cdb2aa6ea2c38a4 /src/routes | |
| parent | 1213ac7a1f5f4f50f742aadebf970e37c186a234 (diff) | |
| download | coinos-ui-c890225add1f5e88595f6ae9ce2a0a9d07d5f050.tar.gz coinos-ui-c890225add1f5e88595f6ae9ce2a0a9d07d5f050.zip | |
send: explain duplicate submits instead of reporting a routing failure
Resubmitting an invoice that was already paid, is still in flight, or is
awaiting reconciliation came back as the generic "failed to route" error,
which reads as if the payment never went out. Map those server responses
to specific messages with a link to the payment history.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte index d3d9f757..7b42a42d 100644 --- a/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte +++ b/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte @@ -48,6 +48,20 @@ (form.message.includes($t("payments.insufficientFunds")) || form.message.includes("Routing fee")), ); + + // A resubmitted invoice (back button, double tap) isn't a routing failure — + // the first attempt went through or is still in flight. Say so instead of + // telling the user the recipient is unreachable. + let duplicate = $derived( + form?.message && + (/already (been )?paid/i.test(form.message) + ? "payments.alreadyPaid" + : form.message.includes("already underway") + ? "payments.alreadyUnderway" + : form.message.includes("still settling") + ? "payments.stillSettling" + : null), + ); </script> <div class="container px-4 max-w-xl mx-auto text-center space-y-2"> @@ -58,6 +72,9 @@ {#if form.message.includes($t("payments.insufficientFunds"))} <div>{$t("payments.lockedBalance")}: {locked}</div> {/if} + {:else if duplicate} + <div>{$t(duplicate)}</div> + <a href="/payments" class="underline">{$t("payments.header")}</a> {:else} {$t("payments.failedToRoute")} {/if} |
