This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#0f172a" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { Switch } from '$lib/components/ui/switch';
|
||||
import { siteSlugs } from '$lib/sites';
|
||||
import { pwaInfo } from 'virtual:pwa-info';
|
||||
|
||||
let { data, children }: {
|
||||
data: { user: { id: string; email?: string; name?: string; avatar?: string; darkmode: boolean } | null };
|
||||
@@ -42,6 +43,11 @@
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
if (pwaInfo) {
|
||||
import('virtual:pwa-register').then(({ registerSW }) => {
|
||||
registerSW({ immediate: true });
|
||||
});
|
||||
}
|
||||
onDarkmodeChange = async (checked: boolean) => {
|
||||
darkmode = checked;
|
||||
try {
|
||||
@@ -58,6 +64,12 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{#if pwaInfo?.webManifest?.linkTag}
|
||||
{@html pwaInfo.webManifest.linkTag}
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
<div class="app-shell">
|
||||
{#if data.user && !isSiteRoute}
|
||||
<header
|
||||
|
||||
Reference in New Issue
Block a user