diff options
| author | Adam Soltys <[email protected]> | 2024-11-07 21:16:25 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-08 09:27:40 -0800 |
| commit | 32fcc461cd43c8907df5e306d520bb671307eab1 (patch) | |
| tree | 0253780c569998b6c1a5f43026586e94916c3fee /src/routes/(app)/account/import | |
| parent | be5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff) | |
| download | coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip | |
svelte 5
Diffstat (limited to 'src/routes/(app)/account/import')
| -rw-r--r-- | src/routes/(app)/account/import/+page.svelte | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/routes/(app)/account/import/+page.svelte b/src/routes/(app)/account/import/+page.svelte index a1d6549b..b94cc839 100644 --- a/src/routes/(app)/account/import/+page.svelte +++ b/src/routes/(app)/account/import/+page.svelte @@ -1,4 +1,6 @@ <script> + import { run, preventDefault } from 'svelte/legacy'; + import { goto } from "$app/navigation"; import { mnemonic } from "$lib/store"; import { fail, focus, versions } from "$lib/utils"; @@ -8,7 +10,7 @@ import { validateMnemonic } from "@scure/bip39"; import { wordlist } from "@scure/bip39/wordlists/english"; - let el, pasted, text; + let el = $state(), pasted = $state(), text = $state(); let paste = async () => { text = await navigator.clipboard.readText(); @@ -26,14 +28,16 @@ } }; - $: if (browser && pasted && text) form.submit() && (pasted = false); + run(() => { + if (browser && pasted && text) form.submit() && (pasted = false); + }); </script> <div class="space-y-5"> <h1 class="text-center text-3xl font-semibold">{$t("accounts.import")}</h1> <div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-2"> - <form on:submit|preventDefault={submit} class="space-y-2"> + <form onsubmit={preventDefault(submit)} class="space-y-2"> <textarea use:focus name="text" @@ -41,7 +45,7 @@ class="w-full p-4 border rounded-xl h-48 text-xl" bind:value={text} autocapitalize="none" - /> +></textarea> <button bind:this={el} type="submit" |
