web/sidebar: simplify settings link logic

This commit is contained in:
dumbmoron 2024-07-04 22:25:47 +00:00
parent 157b687ab5
commit 9ae0473f80
No known key found for this signature in database

View file

@ -12,17 +12,12 @@
import IconComet from "@tabler/icons-svelte/IconComet.svelte"; import IconComet from "@tabler/icons-svelte/IconComet.svelte";
import IconHeart from "@tabler/icons-svelte/IconHeart.svelte"; import IconHeart from "@tabler/icons-svelte/IconHeart.svelte";
import IconInfoCircle from "@tabler/icons-svelte/IconInfoCircle.svelte"; import IconInfoCircle from "@tabler/icons-svelte/IconInfoCircle.svelte";
import { defaultSettingsPage } from "$lib/settings/defaults";
let screenWidth: number, let screenWidth: number;
settingsLink: string; let settingsLink = defaultSettingsPage();
$: isMobile = screenWidth <= 750; $: screenWidth, settingsLink = defaultSettingsPage();
$: if (isMobile) {
settingsLink = "/settings";
} else {
settingsLink = "/settings/general/appearance";
}
</script> </script>
<svelte:window bind:innerWidth={screenWidth} /> <svelte:window bind:innerWidth={screenWidth} />