From 376ff340ad9a0e15efec997c560f7e4db765f65c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 8 Nov 2022 16:33:17 -0800 Subject: handle on-chain deposits --- src/routes/(app)/invoice/[id]/+page.svelte | 37 +++++++------- src/routes/(app)/invoice/[id]/pending/+page.svelte | 56 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 src/routes/(app)/invoice/[id]/pending/+page.svelte (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 463cf31f..dec33b62 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -27,7 +27,7 @@ user: { username, currency } } = invoice; -let src = sm; + let src = sm; let qr; let tipPercent = 0; @@ -51,9 +51,12 @@ let src = sm; $invoices[id] = { amount, id, rate, received, text, tip, username }; $: browser && + $invoices[id].amount > 0 && $invoices[id]?.received >= $invoices[id]?.amount && goto(($invoices[id].memo === 'launch' && '/launch/purchase') || `/invoice/${id}/paid`); + $: browser && $invoices[id].pending > 0 && goto(`/invoice/${id}/pending`); + $: amountFiat = parseFloat(((amount * rate) / sats).toFixed(2)); $: tipAmount = ((tip * rate) / sats).toFixed(2); @@ -69,13 +72,13 @@ let src = sm; $: link = address ? text : `lightning:${text}`; - let full; - let toggle = () => { - screenfull.toggle(qr); - full = !full; - if (full) src = lg; - else src = sm; - } + let full; + let toggle = () => { + screenfull.toggle(qr); + full = !full; + if (full) src = lg; + else src = sm; + }; + -- cgit v1.2.3