Update to svelte 5
This commit is contained in:
@@ -12,7 +12,7 @@ import Footer from "layout/Footer.svelte";
|
||||
import { current_page_store, type Tab } from "./RouterStore";
|
||||
import { get_user, type User } from "lib/PixeldrainAPI";
|
||||
|
||||
export let pages: Tab[] = [
|
||||
let pages: Tab[] = [
|
||||
{
|
||||
path: "/",
|
||||
title: "Home",
|
||||
@@ -61,7 +61,7 @@ onMount(async () => {
|
||||
load_page(window.location.pathname, false)
|
||||
})
|
||||
|
||||
let current_page: Tab = null
|
||||
let current_page: Tab = $state(null)
|
||||
|
||||
const load_page = (pathname: string, history: boolean): boolean => {
|
||||
console.debug("Navigating to page", pathname, "log history:", history)
|
||||
@@ -142,11 +142,11 @@ const popstate = (e: PopStateEvent) => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:document on:click={click}/>
|
||||
<svelte:window on:popstate={popstate}/>
|
||||
<svelte:document onclick={click}/>
|
||||
<svelte:window onpopstate={popstate}/>
|
||||
|
||||
{#if current_page !== null}
|
||||
<svelte:component this={current_page.component} />
|
||||
<current_page.component />
|
||||
|
||||
{#if current_page.footer === undefined || current_page.footer === true}
|
||||
<Footer/>
|
||||
|
||||
Reference in New Issue
Block a user