Update to Astro 4.5

This commit is contained in:
2024-03-11 22:40:14 +01:00
parent f888b6946b
commit b52b2bcfe1
4 changed files with 87 additions and 62 deletions

View File

@@ -5,17 +5,14 @@ import {t} from "astro-i18n";
---
<PageLayout title={t("dashboard.page")}>
<script>
<script is:inline data-astro-rerun>
import {l} from "../util/util";
import {navigate} from "astro:transitions/client";
document.addEventListener("astro:page-load", () => {
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
if ((localStorage.getItem("sw-session") ?? "") === "") {
navigate(l("/login"), {});
}
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
if ((localStorage.getItem("sw-session") ?? "") === "") {
navigate(l("/login"), {});
}
});
}
</script>
<Dashboard client:only="svelte" />
</PageLayout>