add toggle fix and possible log out issue

This commit is contained in:
JCEEE
2026-09-14 12:09:44 +01:00
parent 70a38ee95b
commit 158a60f30c
8 changed files with 120 additions and 49 deletions
+7 -2
View File
@@ -134,11 +134,16 @@
// their OTP on /{fam}/join/{username} then landing on /{fam}/{username}.
// The handle comes from the session (not page.params) so jump-back-in lands
// on the user's own dashboard even from the bare /{fam} page.
// The slug MUST come from the fam record — page.params.fam may be the PB
// id (login ID-fallback / stale link) when page.data.fam failed to load,
// and recording that poisons the shortcut (famSlug === famName === id).
$effect(() => {
if (!page.data.session) return;
const slug = page.data.fam?.slug as string;
if (!slug) return;
recordShortcut({
famSlug: (page.data.fam?.slug as string) || page.params.fam || '',
famName: (page.data.fam?.name as string) || page.params.fam || '',
famSlug: slug,
famName: (page.data.fam?.name as string) || slug,
userName: page.data.session.username || page.params.username || ''
});
});