feat(m5): PWA service worker, offline Dexie store, outbox, sync endpoints
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { hasToken } from '$lib/api/client';
|
||||
import { onMount } from 'svelte';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { startSync, stopSync } from '$lib/stores/sync';
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
@@ -10,8 +11,11 @@
|
||||
if (!hasToken() && page.url.pathname !== '/settings') {
|
||||
goto('/settings');
|
||||
}
|
||||
startSync();
|
||||
});
|
||||
|
||||
onDestroy(stopSync);
|
||||
|
||||
const navItems = [
|
||||
{ href: '/today', label: 'Today' },
|
||||
{ href: '/week', label: 'Week' },
|
||||
|
||||
Reference in New Issue
Block a user