aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-22 08:18:39 -0700
committerAdam Soltys <[email protected]>2026-07-30 10:40:41 -0700
commitf1bd471cf5cbab6ee60a18eded0a9ed489904b13 (patch)
treef5dac313ffa5a4aff3c8460100f1638214df492a /src
parentf884ffabc9afab2d6051379062434fc9e7f61176 (diff)
downloadcoinos-ui-f1bd471cf5cbab6ee60a18eded0a9ed489904b13.tar.gz
coinos-ui-f1bd471cf5cbab6ee60a18eded0a9ed489904b13.zip
payments: show lightning sends as pending until settled
Lightning/bolt12 sends now start unconfirmed (server sets confirmed=false until the HTLC settles and the preimage arrives). Reflect that in the UI: the payment list and detail page show 'Pending' for an unsettled send, and the detail page shows a pending note in place of the empty preimage. Prevents the misleading 'Sent/completed with no preimage' state for held HTLCs (e.g. Ark hold invoices that stay in-flight for hours). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/components/Payments.svelte4
-rw-r--r--src/routes/(app)/payment/[id]/+page.svelte14
2 files changed, 15 insertions, 3 deletions
diff --git a/src/components/Payments.svelte b/src/components/Payments.svelte
index 36633089..232ef552 100644
--- a/src/components/Payments.svelte
+++ b/src/components/Payments.svelte
@@ -111,7 +111,9 @@
? p.confirmed
? $t("payments.received")
: $t("payments.pending")
- : $t("payments.sent")}
+ : p.confirmed
+ ? $t("payments.sent")
+ : $t("payments.pending")}
{/if}
</div>
</div>
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte
index 6551793c..a4c693a0 100644
--- a/src/routes/(app)/payment/[id]/+page.svelte
+++ b/src/routes/(app)/payment/[id]/+page.svelte
@@ -97,7 +97,11 @@
<div class="container mx-auto max-w-lg px-4 space-y-8 break-all text-2xl">
<h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold mb-10">
- {$t(amount < 0 ? "payments.sent" : "payments.received")}
+ {#if amount < 0 && !confirmed && (type === types.lightning || type === types.bolt12)}
+ {$t("payments.pending")}
+ {:else}
+ {$t(amount < 0 ? "payments.sent" : "payments.received")}
+ {/if}
</h1>
{#if p.with}
@@ -195,7 +199,13 @@
<div>
<span class="text-lg text-secondary">{$t("payments.preimage")}</span>
- <div>{ref}</div>
+ <div>
+ {#if ref}
+ {ref}
+ {:else}
+ <span class="text-secondary">{$t("payments.pending")}</span>
+ {/if}
+ </div>
</div>
{/if}