mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
improved component composition and added tests.
This commit is contained in:
+8
-2
@@ -2,8 +2,7 @@
|
||||
/**
|
||||
* Shell: restore the session, then render chrome plus whichever route matched.
|
||||
*/
|
||||
import { router } from '$lib/router.svelte'
|
||||
import { session } from '$lib/stores/session.svelte'
|
||||
import { useAppServices } from '$lib/app-services'
|
||||
import SiteHeader from '$components/chrome/SiteHeader.svelte'
|
||||
import SiteNav from '$components/chrome/SiteNav.svelte'
|
||||
import SiteFooter from '$components/chrome/SiteFooter.svelte'
|
||||
@@ -20,11 +19,15 @@
|
||||
import NotFound from '$routes/NotFound.svelte'
|
||||
import type { TimelineKind } from '$lib/api/endpoints'
|
||||
|
||||
const { router, session } = useAppServices()
|
||||
|
||||
let booted = $state(false)
|
||||
|
||||
$effect(() => {
|
||||
let active = true
|
||||
void (async () => {
|
||||
const landing = await session.restore()
|
||||
if (!active) return
|
||||
booted = true
|
||||
|
||||
if (landing) {
|
||||
@@ -34,6 +37,9 @@
|
||||
router.replace('#/login')
|
||||
}
|
||||
})()
|
||||
return () => {
|
||||
active = false
|
||||
}
|
||||
})
|
||||
|
||||
const route = $derived(router.current)
|
||||
|
||||
Reference in New Issue
Block a user