add shared computer feature
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
// The fam layout renders the shared-device picker when child sessions exist
|
||||
// but none is active. With an active session this route just sends you home.
|
||||
export async function load(event) {
|
||||
const session = event.locals.user;
|
||||
if (session) {
|
||||
const fam = event.params.fam;
|
||||
if (session.role === 'parent') throw redirect(303, `/${fam}`);
|
||||
throw redirect(303, `/${fam}/${encodeURIComponent(session.username || '')}`);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<!-- Shared-device profile picker. The fam layout renders the picker itself in
|
||||
picker mode (no active session, child sessions present) — this page only
|
||||
exists so /{fam}/switch resolves as a route. -->
|
||||
<div></div>
|
||||
Reference in New Issue
Block a user