diff options
| author | Kit La Touche <kit@transneptune.net> | 2024-11-21 16:26:10 -0500 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2024-11-22 12:12:22 -0500 |
| commit | c2f711c56a3bc736cf507a920dee0915b69af77e (patch) | |
| tree | 9d205b2898d1c3f94c5c17ce3debca481f5d3e02 | |
| parent | cbba25f939a12026816c1b8202d821f57606f248 (diff) | |
Use store.set where appropriate
If you're setting it to a static value, use set.
| -rw-r--r-- | ui/lib/components/LogOut.svelte | 2 | ||||
| -rw-r--r-- | ui/routes/(app)/+layout.svelte | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ui/lib/components/LogOut.svelte b/ui/lib/components/LogOut.svelte index 25dd5e9..52aa039 100644 --- a/ui/lib/components/LogOut.svelte +++ b/ui/lib/components/LogOut.svelte @@ -7,7 +7,7 @@ event.preventDefault(); const response = await logOut(); if (200 <= response.status && response.status < 300) { - currentUser.update(() => null); + currentUser.set(null); goto('/login'); } } diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte index cc900a6..e542f24 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -20,10 +20,10 @@ let channel = $derived($page.params.channel); function onBooted(boot) { - currentUser.update(() => ({ + currentUser.set({ id: boot.login.id, username: boot.login.name - })); + }); logins.update((value) => value.setLogins(boot.logins)); channelsList.update((value) => value.setChannels(boot.channels)); messages.update((value) => value.setMessages(boot.messages)); @@ -51,11 +51,11 @@ events = subscribeToEvents(response.data.resume_point); break; case 401: - currentUser.update(() => null); + currentUser.set(null); goto('/login'); break; case 503: - currentUser.update(() => null); + currentUser.set(null); goto('/setup'); break; default: |
