This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import Field from '$ui/components/primitives/Field.svelte';
|
||||
import Input from '$ui/components/primitives/Input.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { roleLabels, type AuthUser } from '$lib/auth.js';
|
||||
import { timeFormat, timeZone, timeZonePersistenceError } from '$ui/stores/time-zone.js';
|
||||
import { availableTimeZones, DEFAULT_TIME_ZONE } from '$lib/time-zone.js';
|
||||
let exampleDate = $state<Date | null>(null);
|
||||
@@ -21,7 +22,7 @@
|
||||
let signingOut = $state(false);
|
||||
let error = $state('');
|
||||
let notice = $state('');
|
||||
const user = $derived($page.data.user);
|
||||
const user = $derived<AuthUser | null>($page.data.user ?? null);
|
||||
async function changePassword(event: SubmitEvent) {
|
||||
event.preventDefault();
|
||||
if (busy || signingOut) return;
|
||||
@@ -88,7 +89,7 @@
|
||||
<section class="panel identity">
|
||||
<div>
|
||||
<h2>{user.displayName}</h2>
|
||||
<p>@{user.username} · <span class="role">{user.role}</span></p>
|
||||
<p>@{user.username} · <span class="role">{roleLabels[user.role]}</span></p>
|
||||
</div>
|
||||
<Button disabled={busy || signingOut} loading={signingOut} onclick={logout}
|
||||
>Sign out</Button
|
||||
|
||||
Reference in New Issue
Block a user