aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-01 10:51:56 -0700
committerAdam Soltys <[email protected]>2022-08-01 10:51:56 -0700
commita54d21b74afb4bfc55c48828a716b43acbbc7819 (patch)
tree0aedaa4193e4a60f8b06fea7fb52b14371d5f151 /src/components
parent7ecf3258c259eb259d8dfb3c4a47d4ede82f5c56 (diff)
downloadcoinos-ui-a54d21b74afb4bfc55c48828a716b43acbbc7819.tar.gz
coinos-ui-a54d21b74afb4bfc55c48828a716b43acbbc7819.zip
catch registration errors
Diffstat (limited to 'src/components')
-rw-r--r--src/components/RegisterOrLogin.svelte5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte
index cbaad236..2463f47f 100644
--- a/src/components/RegisterOrLogin.svelte
+++ b/src/components/RegisterOrLogin.svelte
@@ -18,12 +18,14 @@
}[page];
let submit = async () => {
+ console.log("HI")
let r = await post(url, { username, password });
if (!r.token) r = await post('/login', { username, password });
$token = r.token;
auth();
- user.subscribe(({ username }) => goto(`/${username}/receive`));
};
+
+ $: if ($user) goto(`/${username}/receive`);
</script>
<div class="pt-10">
@@ -40,6 +42,7 @@
<form class="space-y-5" on:submit|preventDefault={submit}>
<div>
<label for="username" class="font-semibold">Username</label>
+ <!-- svelte-ignore a11y-autofocus -->
<input
type="text"
required