improved component composition and added tests.

This commit is contained in:
Moon.eth
2026-07-29 10:30:28 +09:00
parent 95f9d73681
commit 264ae17a8d
39 changed files with 1811 additions and 147 deletions
+8 -2
View File
@@ -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)