Update to svelte 5

This commit is contained in:
2025-10-13 16:05:50 +02:00
parent f936e4c0f2
commit 6d89c5ddd9
129 changed files with 2443 additions and 2180 deletions

View File

@@ -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/>