From c890225add1f5e88595f6ae9ce2a0a9d07d5f050 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 2 Oct 2026 07:10:15 -0700 Subject: 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 --- .../send/lightning/[payreq]/[...memo]/+page.svelte | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/routes') 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), + );
@@ -58,6 +72,9 @@ {#if form.message.includes($t("payments.insufficientFunds"))}
{$t("payments.lockedBalance")}: {locked}
{/if} + {:else if duplicate} +
{$t(duplicate)}
+ {$t("payments.header")} {:else} {$t("payments.failedToRoute")} {/if} -- cgit v1.2.3