diff options
| author | Adam Soltys <[email protected]> | 2026-02-16 21:18:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-16 21:18:37 -0800 |
| commit | 314c86901e8aadf731d0ab235ef371248670e940 (patch) | |
| tree | f305cfdf0efb951012cc988322a701e58b01d1a2 /src/routes/(app)/account | |
| parent | b22c813f9fb3b4d69dade75d22e90e6779919f07 (diff) | |
| download | coinos-ui-314c86901e8aadf731d0ab235ef371248670e940.tar.gz coinos-ui-314c86901e8aadf731d0ab235ef371248670e940.zip | |
account creation flow
Diffstat (limited to 'src/routes/(app)/account')
| -rw-r--r-- | src/routes/(app)/account/new/+page.server.ts | 8 | ||||
| -rw-r--r-- | src/routes/(app)/account/seed/+page.svelte | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/routes/(app)/account/new/+page.server.ts b/src/routes/(app)/account/new/+page.server.ts index d4a0d0cb..7615c6f6 100644 --- a/src/routes/(app)/account/new/+page.server.ts +++ b/src/routes/(app)/account/new/+page.server.ts @@ -1,5 +1,9 @@ +import { auth, get } from "$lib/utils"; import { redirect } from "@sveltejs/kit"; -export async function load() { - redirect(307, "/account/seed"); +export async function load({ cookies }) { + const accounts = await get("/accounts", auth(cookies)); + const hasArk = accounts.some((a: any) => a.type === "ark"); + if (hasArk) redirect(307, "/account/seed"); + return { hasArk }; } diff --git a/src/routes/(app)/account/seed/+page.svelte b/src/routes/(app)/account/seed/+page.svelte index 43b690b3..335d92f2 100644 --- a/src/routes/(app)/account/seed/+page.svelte +++ b/src/routes/(app)/account/seed/+page.svelte @@ -14,14 +14,13 @@ let { data } = $props(); let user = $derived(data.user); - let creating = $state(false); + let creating = $state(true); onMount(async () => { if (!browser) return; const { getWalletEntropy } = await import("$lib/walletEntropy"); const prfKey = await getWalletEntropy(); if (prfKey) { - creating = true; try { const entropy = new Uint8Array(prfKey); const mn = entropyToMnemonic(entropy, wordlist); @@ -45,6 +44,7 @@ } return; } + creating = false; if (!$mnemonic) await generate(); }); |
