mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:01:08 +02:00
feat(manacore/web): wire reminder scheduler into app layout
Start createReminderScheduler with todoReminderSource on auth ready. Request notification permission on app mount. Stop scheduler on destroy. Todo reminders now fire browser notifications when dueDate - minutesBefore is reached. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
034b67825a
commit
7650a83e6e
1 changed files with 10 additions and 0 deletions
|
|
@ -3,6 +3,8 @@
|
|||
import { page } from '$app/stores';
|
||||
import type { Snippet } from 'svelte';
|
||||
import { onDestroy, setContext } from 'svelte';
|
||||
import { createReminderScheduler, notificationService } from '@manacore/shared-stores';
|
||||
import { todoReminderSource } from '$lib/modules/todo/reminder-source';
|
||||
import KeyboardShortcutsModal from '$lib/components/KeyboardShortcutsModal.svelte';
|
||||
import SessionWarning from '$lib/components/SessionWarning.svelte';
|
||||
import { locale, _ } from 'svelte-i18n';
|
||||
|
|
@ -207,6 +209,9 @@
|
|||
import.meta.env.PUBLIC_SYNC_SERVER_URL ||
|
||||
'http://localhost:3050';
|
||||
let unifiedSync: ReturnType<typeof createUnifiedSync> | null = null;
|
||||
const reminderScheduler = createReminderScheduler({
|
||||
sources: [todoReminderSource],
|
||||
});
|
||||
|
||||
async function handleSignOut() {
|
||||
unifiedSync?.stopAll();
|
||||
|
|
@ -271,6 +276,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Phase B2: Start reminder scheduler
|
||||
reminderScheduler.start();
|
||||
notificationService.requestPermission();
|
||||
|
||||
// Phase C: Guest mode — welcome modal + nudge
|
||||
if (!authStore.isAuthenticated) {
|
||||
markAsGuest();
|
||||
|
|
@ -283,6 +292,7 @@
|
|||
|
||||
onDestroy(() => {
|
||||
unifiedSync?.stopAll();
|
||||
reminderScheduler.stop();
|
||||
guestMode?.destroy();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue