Skip to content

Commit 2bed634

Browse files
committed
fix: store null on onboarding.
1 parent e23f965 commit 2bed634

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/stores/user.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export type Account = Models.User<
1313
>;
1414

1515
export const user = derived(page, ($page) => {
16-
if (browser) sessionStorage.setItem('account', JSON.stringify($page.data.account));
17-
return $page.data.account as Account;
16+
if ($page.data?.account) {
17+
if (browser) {
18+
sessionStorage.setItem('account', JSON.stringify($page.data.account));
19+
}
20+
return $page.data.account as Account;
21+
} else return null;
1822
});

0 commit comments

Comments
 (0)