diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-11-02 20:02:24 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-11-02 20:02:24 -0400 |
| commit | 22ce0549e20ee397cf5953bd6b7aafc752deaa28 (patch) | |
| tree | 59e116cd0a198de04a2dbd3bbb632ec3dee6fed5 /ui/lib/components/CurrentUser.svelte | |
| parent | 0e14a3b7e365c05992848cfbc4b8d7d9681d6d04 (diff) | |
Run prettier, make lint part of pre-commit
Diffstat (limited to 'ui/lib/components/CurrentUser.svelte')
| -rw-r--r-- | ui/lib/components/CurrentUser.svelte | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/ui/lib/components/CurrentUser.svelte b/ui/lib/components/CurrentUser.svelte index 4b1b974..97ff980 100644 --- a/ui/lib/components/CurrentUser.svelte +++ b/ui/lib/components/CurrentUser.svelte @@ -1,25 +1,24 @@ <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() { - const response = await logOut(); - if (200 <= response.status && response.status < 300) { - currentUser.update(() => null); - goto('/login'); - } - } + async function handleLogout() { + const response = await logOut(); + if (200 <= response.status && response.status < 300) { + currentUser.update(() => null); + goto('/login'); + } + } </script> <form on:submit|preventDefault={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> |
