feat: redirect from dashboard to post page on load
Some checks failed
Frontend CI / build (push) Failing after 59s
Some checks failed
Frontend CI / build (push) Failing after 59s
This commit is contained in:
parent
d74c5b82c2
commit
7f03cfa3c9
@ -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');
|
|
||||||
}
|
|
||||||
};
|
|
@ -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>
|
Loading…
x
Reference in New Issue
Block a user