add more ux and ui patches with extra login helper
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import { notices } from '$lib/stores/notices.svelte';
|
||||
import { Sidebar, TopNav, Footer, Chat } from '$lib/components';
|
||||
import { chatIcon } from '$lib/components/icons';
|
||||
import { recordShortcut } from '$lib/shortcut';
|
||||
import type { Session } from '$lib/types';
|
||||
|
||||
let { children, data } = $props();
|
||||
@@ -97,11 +98,24 @@
|
||||
return map[reason] || 'Access paused.';
|
||||
}
|
||||
|
||||
// Claim toast watcher (admin only)
|
||||
// Claim toast watcher (admin only)
|
||||
let claimToast = $state('');
|
||||
let prevClaimedIds = new Set<string>();
|
||||
let mounted = false;
|
||||
|
||||
// Persist a returning-user shortcut (localStorage) whenever an authenticated
|
||||
// session exists. $effect (not onMount) so it also fires when the session
|
||||
// appears after the layout was already mounted — e.g. a member redeeming
|
||||
// their OTP on /{fam}/join/{username} then landing on /{fam}/{username}.
|
||||
$effect(() => {
|
||||
if (!page.data.session) return;
|
||||
recordShortcut({
|
||||
famSlug: page.params.fam || '',
|
||||
famName: (page.data.fam?.name as string) || page.params.fam || '',
|
||||
userName: page.data.role === 'parent' ? '' : page.params.username || ''
|
||||
});
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (!session || !famStore.initialized) return;
|
||||
const rewards = famStore.rewards;
|
||||
|
||||
Reference in New Issue
Block a user