aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-25 13:26:19 -0800
committerAdam Soltys <[email protected]>2026-02-25 13:26:19 -0800
commitb137cdfca84cf68a2b8a620ba1c55337e88a0050 (patch)
treec3f5482b08ce175fc4335d3f99838c06bb510877 /src/routes
parent75bc8ecc68362616a233f0852361b2dc79bcdbba (diff)
downloadcoinos-ui-b137cdfca84cf68a2b8a620ba1c55337e88a0050.tar.gz
coinos-ui-b137cdfca84cf68a2b8a620ba1c55337e88a0050.zip
fix lightning receive redirect
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/(app)/[username]/receive/+page.svelte12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte
index 14489c13..a0ab38a2 100644
--- a/src/routes/(app)/[username]/receive/+page.svelte
+++ b/src/routes/(app)/[username]/receive/+page.svelte
@@ -3,7 +3,7 @@
import { btc, loc, post, copy, fail, f, get, types, sat, s, sats } from "$lib/utils";
import { tick, onMount, onDestroy } from "svelte";
import { browser } from "$app/environment";
- import { last, showQr, amountPrompt } from "$lib/store";
+ import { last, lastPayment, showQr, amountPrompt } from "$lib/store";
import Avatar from "$comp/Avatar.svelte";
import InvoiceData from "$comp/InvoiceData.svelte";
import InvoiceActions from "$comp/InvoiceActions.svelte";
@@ -109,10 +109,20 @@
let txt = $derived([types.bitcoin, types.liquid].includes(type) ? hash : text);
onMount(() => {
+ $lastPayment = null;
if ($amountPrompt && !amount) toggleAmount();
let address_type = $page.url.searchParams.get("address_type");
if (address_type) setType(types.bitcoin, address_type);
});
+
+ $effect(() => {
+ if ($lastPayment?.iid) {
+ const { iid, confirmed } = $lastPayment;
+ const target = confirmed ? `/invoice/${iid}/paid` : `/invoice/${iid}`;
+ $lastPayment = null;
+ goto(target);
+ }
+ });
</script>
<div class="invoice container mx-auto max-w-xl px-4 space-y-2">