feat: redirect from dashboard to post page on load
Some checks failed
Frontend CI / build (push) Failing after 59s

This commit is contained in:
SquidSpirit 2025-10-13 20:27:49 +08:00
parent d74c5b82c2
commit 7f03cfa3c9
2 changed files with 11 additions and 10 deletions

View File

@ -1,10 +0,0 @@
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ url }) => {
const { pathname } = url;
if (pathname === '/dashboard') {
redirect(302, '/dashboard/post');
}
};

View File

@ -0,0 +1,11 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { page } from '$app/state';
import { onMount } from 'svelte';
onMount(() => {
if (page.url.pathname === '/dashboard') {
goto('/dashboard/post');
}
});
</script>