fix(#64): Address PR comments

This commit is contained in:
Josh Creek
2026-01-10 18:27:01 +00:00
parent 68cc2a0712
commit f17b350e4e
9 changed files with 434 additions and 340 deletions
+17
View File
@@ -24,6 +24,19 @@
onMount(async () => {
await getUser();
// Listen for auth state changes to keep the user store in sync
const {
data: { subscription }
} = supabase.auth.onAuthStateChange((event, session) => {
console.log('[Layout] Auth state changed:', event, session ? 'Session found' : 'No session');
if (session) {
localUser = session.user;
} else {
localUser = null;
}
user.set(localUser);
});
if (pwaInfo) {
const { registerSW } = await import('virtual:pwa-register');
registerSW({
@@ -41,6 +54,10 @@
}
});
}
return () => {
subscription.unsubscribe();
};
});
async function getUser() {