From 72f3d8c5ab3e2a42cf1a76d0c08815dbe46e50a1 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 11 Oct 2024 01:18:18 -0400 Subject: Move login to its own route. This - in passing - fixes the problem where the client failed to subscribe after logging in, by causing the whole subscription process to be re-run when returning to the main interface. --- ui/lib/apiServer.js | 2 ++ ui/lib/components/LogIn.svelte | 4 +++- ui/lib/components/LogOut.svelte | 8 ++++++-- ui/lib/components/MessageInput.svelte | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'ui/lib') diff --git a/ui/lib/apiServer.js b/ui/lib/apiServer.js index 538fa85..ccd6e66 100644 --- a/ui/lib/apiServer.js +++ b/ui/lib/apiServer.js @@ -66,6 +66,8 @@ export function subscribeToEvents(resume_point) { break; } } + + return evtSource; } function onLoginEvent(data) { diff --git a/ui/lib/components/LogIn.svelte b/ui/lib/components/LogIn.svelte index 2836e6d..e1cda8a 100644 --- a/ui/lib/components/LogIn.svelte +++ b/ui/lib/components/LogIn.svelte @@ -1,4 +1,5 @@
- @{$currentUser.username} + {#if $currentUser} + @{$currentUser.username} + {/if}