From 0bf630c39fe290ea2718eab7a0759d978c736ef9 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 26 Nov 2024 13:08:08 -0800 Subject: bip21 and socket fixes --- src/routes/(app)/invoice/[id]/+layout@.svelte | 110 -------------------------- src/routes/(app)/invoice/[id]/+page.svelte | 24 ++++-- 2 files changed, 16 insertions(+), 118 deletions(-) delete mode 100644 src/routes/(app)/invoice/[id]/+layout@.svelte (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/[id]/+layout@.svelte b/src/routes/(app)/invoice/[id]/+layout@.svelte deleted file mode 100644 index 13b121d8..00000000 --- a/src/routes/(app)/invoice/[id]/+layout@.svelte +++ /dev/null @@ -1,110 +0,0 @@ - - -{#if browser && user && $passwordPrompt} - -{/if} - - - {#if subject} - coinos - {subject.username} - - {:else} - coinos - {/if} - - {#if subject?.profile} - - {:else} - - {/if} - - - - -
- - {#if !$loading} - {@render children?.()} - {/if} -
diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 8c6e2b75..3ad20f68 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -56,13 +56,21 @@ }); let setType = async (type) => { - invoice.type = type; - ({ id } = await post(`/invoice`, { - invoice, - user: { username, currency }, - })); - - goto(`./${id}?options=true`, { invalidateAll: true, noScroll: true }); + $showQr = true; + if (type === types.lightning && !amount) + goto(`/${username}/receive`, { invalidateAll: true, noScroll: true }); + else { + invoice.type = type; + ({ id } = await post(`/invoice`, { + invoice, + user: { username, currency }, + })); + + goto(`/invoice/${id}?options=true`, { + invalidateAll: true, + noScroll: true, + }); + } }; let setAmount = async (e) => { @@ -74,7 +82,7 @@ if (typeof $amountPrompt === "undefined") $amountPrompt = true; invoice.amount = newAmount; invoice.tip = 0; - + ({ id } = await post(`/invoice`, { invoice, user: { username, currency }, -- cgit v1.2.3