diff --git a/src/routes/(components)/layout/DesktopLayout.svelte b/src/routes/(components)/layout/DesktopLayout.svelte index 7b79c8ce..62749356 100644 --- a/src/routes/(components)/layout/DesktopLayout.svelte +++ b/src/routes/(components)/layout/DesktopLayout.svelte @@ -17,7 +17,7 @@
- diff --git a/src/routes/(components)/layout/NavLinks.svelte b/src/routes/(components)/layout/NavLinks.svelte index f64ce3d1..ac4cfd03 100644 --- a/src/routes/(components)/layout/NavLinks.svelte +++ b/src/routes/(components)/layout/NavLinks.svelte @@ -3,11 +3,12 @@ export let sheetOpen: boolean | undefined = undefined; const linkItems: { text: string; href: string }[] = [ - { text: 'Workouts', href: '/workouts' }, - { text: 'Mesocycles', href: '/mesocycles' }, + { text: 'Dashboard', href: '/dashboard' }, { text: 'Exercise splits', href: '/exercise-splits' }, - { text: 'Privacy policy', href: '/privacy-policy' }, - { text: 'Donations', href: '/donations' } + { text: 'Mesocycles', href: '/mesocycles' }, + { text: 'Workouts', href: '/workouts' }, + { text: 'Donations', href: '/donations' }, + { text: 'Privacy policy', href: '/privacy-policy' } ]; diff --git a/src/routes/(components)/page/ActionButtons.svelte b/src/routes/(components)/page/ActionButtons.svelte index d5248b4d..eac0032e 100644 --- a/src/routes/(components)/page/ActionButtons.svelte +++ b/src/routes/(components)/page/ActionButtons.svelte @@ -7,7 +7,9 @@ import GitHub from 'virtual:icons/lucide/github'; import Star from 'virtual:icons/lucide/star'; import LoginProviderMenu from '../layout/LoginProviderMenu.svelte'; + import type { Session } from '@auth/sveltekit'; + let { session }: { session: Session | null } = $props(); let stars: number | undefined = $state(); onMount(async () => { @@ -30,10 +32,12 @@ {/if} - - - - - - + {#if session === null} + + + + + + + {/if} diff --git a/src/routes/(components)/page/DesktopLandingPage.svelte b/src/routes/(components)/page/DesktopLandingPage.svelte index e2e43c24..468ad562 100644 --- a/src/routes/(components)/page/DesktopLandingPage.svelte +++ b/src/routes/(components)/page/DesktopLandingPage.svelte @@ -22,7 +22,7 @@ - + diff --git a/src/routes/(components)/page/MobileLandingPage.svelte b/src/routes/(components)/page/MobileLandingPage.svelte index 43c4a1ba..5b28f07c 100644 --- a/src/routes/(components)/page/MobileLandingPage.svelte +++ b/src/routes/(components)/page/MobileLandingPage.svelte @@ -18,7 +18,7 @@ - + diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 027540ff..664bb4e6 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -1,11 +1,13 @@ import { prisma } from '$lib/prisma.js'; +import type { Session } from '@auth/sveltekit'; import { redirect } from '@sveltejs/kit'; -export const load = async ({ parent }) => { +export const load = async ({ parent, url }) => { const { session } = await parent(); - if (session) redirect(302, '/dashboard'); + if (session && !url.searchParams.has('forceView')) redirect(302, '/dashboard'); return { + session, workoutCount: prisma.workout.count(), exerciseCount: prisma.workoutExercise.count(), setsCount: prisma.workoutExerciseSet.count() @@ -13,6 +15,7 @@ export const load = async ({ parent }) => { }; export type HomePageCounts = { + session: Session | null; workoutCount: Promise; exerciseCount: Promise; setsCount: Promise;