Some small portal fixes
This commit is contained in:
@@ -248,7 +248,7 @@
|
|||||||
bind:value={calculation.player.metrics.weight}
|
bind:value={calculation.player.metrics.weight}
|
||||||
>
|
>
|
||||||
{#each range(400) as weight}
|
{#each range(400) as weight}
|
||||||
<option value={String(lbToKg(weight))}
|
<option value={lbToKg(weight)}
|
||||||
>{weight}</option
|
>{weight}</option
|
||||||
>
|
>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -13,15 +13,22 @@
|
|||||||
const password = new FormData(form).get("password")?.toString() ?? "";
|
const password = new FormData(form).get("password")?.toString() ?? "";
|
||||||
|
|
||||||
loading = true;
|
loading = true;
|
||||||
const { status } = await api.auth.login.post({ password });
|
try {
|
||||||
loading = false;
|
const { status } = await api.auth.login.post({ password });
|
||||||
|
|
||||||
if (status === 401) {
|
if (status === 401) {
|
||||||
error = "Invalid password";
|
error = "Invalid password";
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await goto("/");
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
error = "Unable to reach the server. Please try again.";
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
await goto("/");
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user