From 41ee0027e1767e4d116330bdee2e0456fd45f940 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 25 Nov 2024 22:13:04 -0800 Subject: fix amount prompt --- src/routes/(app)/invoice/[id]/+page.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (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 15dc97ae..8c6e2b75 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -65,11 +65,16 @@ goto(`./${id}?options=true`, { invalidateAll: true, noScroll: true }); }; - let setAmount = $state(async () => { - if (typeof $amountPrompt === "undefined") $amountPrompt = true; + let setAmount = async (e) => { + e.preventDefault(); + e.stopPropagation(); + settingAmount = false; + + if (typeof $amountPrompt === "undefined") $amountPrompt = true; invoice.amount = newAmount; invoice.tip = 0; + ({ id } = await post(`/invoice`, { invoice, user: { username, currency }, @@ -80,7 +85,7 @@ else url += "?options=true"; goto(url, { invalidateAll: true, noScroll: true }); - }); + }; let newAmount = $state(0); let settingAmount = $state(); -- cgit v1.2.3