summaryrefslogtreecommitdiff
path: root/ui/lib/components/CurrentUser.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-03 21:47:30 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-03 21:47:30 -0500
commit65381f49cc9abce98c1c63c399fdcfc8ce76c3f5 (patch)
treee0b1eea57aa8b431aa83e2efc4577c12d3cc2b29 /ui/lib/components/CurrentUser.svelte
parent30fa0c4c1faece6b054105fe3cce5107f24a2fa2 (diff)
parentf38881f3253b3a128154ffd95655859e3dc629dc (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.svelte34
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>