aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-25 22:13:04 -0800
committerAdam Soltys <[email protected]>2024-11-25 22:13:04 -0800
commit2761363d694d3f24600abbe656769f64d7a67605 (patch)
tree8c2d2362f57060a62870909a8551686e605cd942 /src/routes/(app)/invoice
parent6874ab9feb1e789c2c9b4c568b29aba9bb2190f6 (diff)
downloadcoinos-ui-2761363d694d3f24600abbe656769f64d7a67605.tar.gz
coinos-ui-2761363d694d3f24600abbe656769f64d7a67605.zip
fix amount prompt
Diffstat (limited to 'src/routes/(app)/invoice')
-rw-r--r--src/routes/(app)/invoice/[id]/+page.svelte11
1 files changed, 8 insertions, 3 deletions
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();