From f30d16a3fd8bab8926d235020a3a710368a74350 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 26 Dec 2023 11:34:14 -0800 Subject: [PATCH] chore: layout comments added --- src/routes/+layout.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index f7752712..78b550d2 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -18,6 +18,7 @@ const backendConfig = await getBackendConfig(); if (backendConfig) { + // Save Backend Status to Store await config.set(backendConfig); console.log(backendConfig); @@ -30,8 +31,10 @@ }); if (sessionUser) { + // Save Session User to Store await user.set(sessionUser); } else { + // Redirect Invalid Session User to /auth Page localStorage.removeItem('token'); await goto('/auth'); } @@ -40,6 +43,7 @@ } } } else { + // Redirect to /error when Backend Not Detected await goto(`/error`); }