Remove Reload

This commit is contained in:
2024-02-28 17:42:10 +01:00
parent c613cef5c4
commit 77bf19a1c8
2 changed files with 12 additions and 8 deletions

View File

@@ -9,11 +9,13 @@ import {t} from "astro-i18n";
import {l} from "../util/util";
import {navigate} from "astro:transitions/client";
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
if ((localStorage.getItem("sw-session") ?? "") === "") {
navigate(l("/login"), {});
document.addEventListener("astro:page-load", () => {
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>