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