File tree Expand file tree Collapse file tree
src/routes/(authenticated) Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { goto } from ' $app/navigation' ;
3- import { page } from ' $app/state' ;
43 import Container from ' $lib/components/Container.svelte' ;
54 import LoadingCircle from ' $lib/components/svg/LoadingCircle.svelte' ;
6- import { Button } from ' $lib/components/ui/button' ;
75 import { UserStore } from ' $lib/stores/UserStore' ;
86 import type { Snippet } from ' svelte' ;
97
108 let { children }: { children: Snippet } = $props ();
119
1210 $effect (() => {
13- if (! $UserStore .loading && ! $UserStore .self ) {
14- goto (page .url .searchParams .get (' redirect' ) ?? ' /login' );
15- }
11+ if (! $UserStore .loading && ! $UserStore .self ) goto (' /login' );
1612 });
1713 </script >
1814
19- {#if $UserStore .loading }
15+ {#if ! $UserStore .self }
2016 <Container >
2117 <LoadingCircle class =" size-20" />
2218 </Container >
23- {:else if $UserStore .self === null }
24- <Container >
25- <h1 class =" text-4xl" >You need to be logged in to access this page</h1 >
26- <Button href =" /login" >Login</Button >
27- </Container >
2819{:else }
2920 {@render children ()}
3021{/if }
You can’t perform that action at this time.
0 commit comments