oweme/apps/web/src/lib/ui.svelte.ts
agent 8fbbb4933e Add Svelte web client and service worker
Mobile-first PWA: groups via key-in-fragment links, encrypted outbox and
sync over SSE, all split modes, currencies with ECB rate prefill, photos,
comments, history and rewind, stats, recurring expenses, CSV and backup,
EN/CS, dark/light theme, Web Push decrypted in the service worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
2026-10-09 19:59:16 +00:00

14 lines
393 B
TypeScript

// Small bits of global UI state: toasts and the "new version" prompt.
class Ui {
toast = $state<string | null>(null);
updateReady = $state(false);
private timer: ReturnType<typeof setTimeout> | undefined;
show(msg: string, ms = 2500) {
this.toast = msg;
clearTimeout(this.timer);
this.timer = setTimeout(() => (this.toast = null), ms);
}
}
export const ui = new Ui();