aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/fund
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 23:23:32 -0800
committerAdam Soltys <[email protected]>2026-02-11 23:23:32 -0800
commit13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121 (patch)
tree076cd631b671ff5ab74dee08c775c20c192ac659 /src/routes/(app)/fund
parent2e61e8abbc318c36969cb5add0c63df81135b4ab (diff)
downloadcoinos-ui-13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121.tar.gz
coinos-ui-13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121.zip
fix svelte errors
Diffstat (limited to 'src/routes/(app)/fund')
-rw-r--r--src/routes/(app)/fund/[id]/+page.server.ts2
-rw-r--r--src/routes/(app)/fund/[id]/+page.svelte8
-rw-r--r--src/routes/(app)/fund/[id]/authorize/[...amount]/+page.server.ts2
-rw-r--r--src/routes/(app)/fund/[id]/authorize/[...amount]/+page.svelte7
-rw-r--r--src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts5
-rw-r--r--src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte8
-rw-r--r--src/routes/(app)/fund/[id]/withdraw/+page.svelte14
7 files changed, 31 insertions, 15 deletions
diff --git a/src/routes/(app)/fund/[id]/+page.server.ts b/src/routes/(app)/fund/[id]/+page.server.ts
index 5a30e560..15d02507 100644
--- a/src/routes/(app)/fund/[id]/+page.server.ts
+++ b/src/routes/(app)/fund/[id]/+page.server.ts
@@ -3,7 +3,7 @@ import { redirect } from "@sveltejs/kit";
export const actions = {
default: async ({ cookies, locals, params }) => {
- const { user } = locals;
+ const { user } = locals as any;
if (user) {
await post("/redeem", params, auth(cookies));
diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte
index 8d83038b..7e123da0 100644
--- a/src/routes/(app)/fund/[id]/+page.svelte
+++ b/src/routes/(app)/fund/[id]/+page.svelte
@@ -14,11 +14,15 @@
let { data }: any = $props();
- let { amount, payments, managers, rate, user } = data;
+ let amount = $derived(data.amount);
+ let payments = $derived(data.payments);
+ let managers = $derived(data.managers);
+ let rate = $derived(data.rate);
+ let user = $derived(data.user);
let { id } = $page.params;
let locale = $derived(loc(user));
- let currency = user ? user.currency : "CAD";
+ let currency = $derived(user ? user.currency : "CAD");
let amountFiat = $derived(parseFloat(((amount * rate) / sats).toFixed(2)));
$effect(() => {
diff --git a/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.server.ts b/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.server.ts
index 94d9ff62..5792688d 100644
--- a/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.server.ts
+++ b/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.server.ts
@@ -20,7 +20,7 @@ export async function load({ cookies, params, parent }) {
amount = balance.amount;
} else if (currency) {
fiat = amount;
- amount = Math.round((fiat * sats) / rate);
+ amount = String(Math.round((Number(fiat) * sats) / rate));
}
if (!amount) redirect(307, `/fund/${id}`);
diff --git a/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.svelte b/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.svelte
index d49e047e..c1312873 100644
--- a/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.svelte
+++ b/src/routes/(app)/fund/[id]/authorize/[...amount]/+page.svelte
@@ -7,7 +7,12 @@
let { data } = $props();
- let { amount, currency, id, user, rate, rates } = data;
+ let amount = $derived(data.amount);
+ let currency = $derived(data.currency);
+ let id = $derived(data.id);
+ let user = $derived(data.user);
+ let rate = $derived(data.rate);
+ let rates = $derived(data.rates);
let locale = $derived(loc(user));
</script>
diff --git a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts
index 82854fb2..a20f8764 100644
--- a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts
+++ b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts
@@ -19,7 +19,7 @@ export async function load({ cookies, request, params, parent }) {
const balance = await get(`/fund/${id}`);
amount = balance.authorization || balance.amount;
} else if (currency) {
- amount = Math.round((amount * sats) / rate);
+ amount = String(Math.round((Number(amount) * sats) / rate));
}
const username = randomName() + Math.floor(Math.random() * 99) + 1;
@@ -36,8 +36,7 @@ export async function load({ cookies, request, params, parent }) {
};
let redirectUrl = `/fund/${id}/sweep`;
- if (params.amount && !params.currency) redirectUrl += `/${params.amount}`;
- if (params.currency) redirectUrl += `/${params.amount}/params.currency}`;
+ if (params.amount) redirectUrl += `/${params.amount}`;
const extraHeaders: Record<string, string> = {};
if (env.INTERNAL_API_KEY) extraHeaders["x-api-key"] = env.INTERNAL_API_KEY;
diff --git a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte
index 40ceafb8..6c656bd4 100644
--- a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte
+++ b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte
@@ -8,7 +8,13 @@
let { data } = $props();
- let { amount, currency, id, user, rate, rates, password: pw } = data;
+ let amount = $derived(data.amount);
+ let currency = $derived(data.currency);
+ let id = $derived(data.id);
+ let user = $derived(data.user);
+ let rate = $derived(data.rate);
+ let rates = $derived(data.rates);
+ let pw = $derived(data.password);
let locale = $derived(loc(user));
onMount(() => ($password = pw));
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.svelte b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
index a37185ed..50662317 100644
--- a/src/routes/(app)/fund/[id]/withdraw/+page.svelte
+++ b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
@@ -6,20 +6,22 @@
import Numpad from "$comp/Numpad.svelte";
import Spinner from "$comp/Spinner.svelte";
import { page } from "$app/stores";
- import { loc, s, f, sats } from "$lib/utils";
+ import { focus, loc, s, f, sats } from "$lib/utils";
import { fiat, pin } from "$lib/store";
let { data, form } = $props();
- let { user } = $derived(data);
- let { currency } = $derived(user);
+ let user = $derived(data.user);
+ let currency = $derived(user.currency);
let loading = $state();
- let { id, balance, rate } = $derived(data);
- let { amount } = $state(data);
+ let id = $derived(data.id);
+ let balance = $derived(data.balance);
+ let rate = $derived(data.rate);
+ let amount = $state(data.amount);
let locale = $derived(loc(user));
let submit = $state();
- let submitting = $state();
+ let submitting = $state(false);
let toggle = () => (submitting = !submitting);
$effect(() => {
if (form?.message.includes("pin")) $pin = undefined;