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
14 lines
393 B
TypeScript
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();
|