diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-11-03 21:47:30 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-11-03 21:47:30 -0500 |
| commit | 65381f49cc9abce98c1c63c399fdcfc8ce76c3f5 (patch) | |
| tree | e0b1eea57aa8b431aa83e2efc4577c12d3cc2b29 /ui/lib/components/CurrentUser.svelte | |
| parent | 30fa0c4c1faece6b054105fe3cce5107f24a2fa2 (diff) | |
| parent | f38881f3253b3a128154ffd95655859e3dc629dc (diff) | |
Merge remote-tracking branch 'origin/wip/actually-configure-prettier'
Diffstat (limited to 'ui/lib/components/CurrentUser.svelte')
| -rw-r--r-- | ui/lib/components/CurrentUser.svelte | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/ui/lib/components/CurrentUser.svelte b/ui/lib/components/CurrentUser.svelte index 46c76b0..56bf915 100644 --- a/ui/lib/components/CurrentUser.svelte +++ b/ui/lib/components/CurrentUser.svelte @@ -1,25 +1,25 @@ <script> - import { goto } from '$app/navigation'; - import { logOut } from '$lib/apiServer'; - import { currentUser } from '$lib/store'; + import { goto } from '$app/navigation'; + import { logOut } from '$lib/apiServer'; + import { currentUser } from '$lib/store'; - async function handleLogout(event) { - event.preventDefault(); - const response = await logOut(); - if (200 <= response.status && response.status < 300) { - currentUser.update(() => null); - goto('/login'); - } - } + async function handleLogout(event) { + event.preventDefault(); + const response = await logOut(); + if (200 <= response.status && response.status < 300) { + currentUser.update(() => null); + goto('/login'); + } + } </script> <form onsubmit={handleLogout}> - {#if $currentUser} - <a href="/me">@{$currentUser.username}</a> - {/if} - <button class="border-slate-500 border-solid border-2 font-bold p-1 rounded" type="submit" - >log out</button - > + {#if $currentUser} + <a href="/me">@{$currentUser.username}</a> + {/if} + <button class="border-slate-500 border-solid border-2 font-bold p-1 rounded" type="submit" + >log out</button + > </form> <style> |
