From 4bc319a709d27bcdb805294e019d53e25f6e00c5 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 3 Feb 2026 11:41:09 -0800 Subject: fix warnings --- src/routes/(app)/pay/[username]/[...amount]/+page.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/routes/(app)/pay') diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte index 618504ca..82fa3750 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte @@ -12,14 +12,19 @@ let { subject, rate, user } = $state(data); let currency = subject?.currency || "USD"; - let locale = $derived(loc(subject)); + let locale = $derived(() => loc(subject)); let next = $state(); let initialAmount = $derived(form?.amount || data.amount); - let amount = $state(initialAmount); - let fiat = $state(!initialAmount); + let amount = $state(); + let fiat = $state(); let formElement = $state(); + $effect(() => { + if (typeof amount === "undefined") amount = initialAmount; + if (typeof fiat === "undefined") fiat = !initialAmount; + }); + let setMax = async (e) => { e.preventDefault(); let body = new FormData(formElement); -- cgit v1.2.3