Skip to content

Commit

Permalink
simplify home page access
Browse files Browse the repository at this point in the history
  • Loading branch information
fivaz committed Jun 22, 2024
1 parent 92a8420 commit 9c99910
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { homeRoute, loginRoute } from '$lib/consts';
import { auth } from '$lib/firebase';
import { Loader2 } from '@steeze-ui/lucide-icons';
import { Icon } from '@steeze-ui/svelte-icon';
import { onAuthStateChanged } from 'firebase/auth';
import { homeRoute } from '$lib/consts';
import { onMount } from 'svelte';
onMount(() => {
onAuthStateChanged(auth, (user) => {
goto(user ? homeRoute : loginRoute);
});
});
onMount(() => goto(homeRoute));
</script>

<div class="flex h-screen items-center justify-center">
<div class="flex gap-3">
<Icon class="h-6 w-6 animate-spin" src={Loader2} />
<p class="font-semibold">Loading...</p>
</div>
</div>

0 comments on commit 9c99910

Please sign in to comment.