web: make everything ssr-compatible

This commit is contained in:
dumbmoron
2024-08-31 17:46:10 +00:00
parent 4b4fce326f
commit 51c140fbfa
9 changed files with 91 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import { page } from "$app/stores";
import { browser } from "$app/environment";
import settings from "$lib/state/settings";
import { version } from "$lib/version";
@@ -38,7 +39,7 @@
$: isMobile = screenWidth <= 750;
$: isHome = $page.url.pathname === "/settings";
$: {
if (!isMobile && isHome) {
if (browser && !isMobile && isHome) {
goto(defaultSettingsPage(), { replaceState: true });
}
}