diff options
| author | Adam Soltys <[email protected]> | 2026-02-11 23:23:32 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 23:23:32 -0800 |
| commit | 13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121 (patch) | |
| tree | 076cd631b671ff5ab74dee08c775c20c192ac659 /src/routes/(app)/pay | |
| parent | 2e61e8abbc318c36969cb5add0c63df81135b4ab (diff) | |
| download | coinos-ui-13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121.tar.gz coinos-ui-13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121.zip | |
fix svelte errors
Diffstat (limited to 'src/routes/(app)/pay')
| -rw-r--r-- | src/routes/(app)/pay/[username]/[...amount]/+page.server.ts | 2 | ||||
| -rw-r--r-- | src/routes/(app)/pay/[username]/[...amount]/+page.svelte | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts b/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts index 23918cb3..f1e5a073 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts @@ -16,7 +16,7 @@ export async function load({ cookies, params, parent }) { if (currency && !rate) error(500, "Invalid currency symbol"); if (amount) { - if (currency) amount = (amount * sats) / rate; + if (currency) amount = String((Number(amount) * sats) / rate); const { id } = await post( "/invoice", diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte index aa46cfd5..25e03e8f 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte @@ -18,10 +18,10 @@ let locale = $derived(loc(subject)); let next = $state(); - let initialAmount = $derived(form?.amount || data.amount); + let initialAmount = $derived((form as any)?.amount || data.amount); let amount = $state(); let fiat = $state(); - let formElement = $state(); + let formElement: HTMLFormElement | undefined = $state(); $effect(() => { if (typeof amount === "undefined") amount = initialAmount; @@ -31,10 +31,10 @@ let setMax = async (e) => { e.preventDefault(); let body = new FormData(formElement); - body.set("fiat", false); + body.set("fiat", String(false)); body.set("amount", user.balance); - const response = await fetch(formElement.action, { + const response = await fetch(formElement!.action, { method: "POST", body, }); |
