Initial commit: Outlook-competitor desktop mail client
Tauri v2 (Rust backend, React/TypeScript frontend). IMAP/POP3/SMTP core, Google OAuth (mail/calendar/contacts sync), CalDAV, local calendar with recurrence, rules engine, contacts, tasks, unified inbox, context menus, drag & drop, snooze, templates, and more.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
export interface AppSettings {
|
||||
desktop: boolean
|
||||
popup: boolean
|
||||
composePopup: boolean
|
||||
}
|
||||
|
||||
const KEY = 'mailclient.notifySettings'
|
||||
|
||||
const DEFAULTS: AppSettings = { desktop: true, popup: true, composePopup: false }
|
||||
|
||||
export function loadAppSettings(): AppSettings {
|
||||
try {
|
||||
const raw = localStorage.getItem(KEY)
|
||||
if (!raw) return DEFAULTS
|
||||
const parsed = JSON.parse(raw) as Partial<AppSettings>
|
||||
return {
|
||||
desktop: parsed.desktop ?? DEFAULTS.desktop,
|
||||
popup: parsed.popup ?? DEFAULTS.popup,
|
||||
composePopup: parsed.composePopup ?? DEFAULTS.composePopup,
|
||||
}
|
||||
} catch {
|
||||
return DEFAULTS
|
||||
}
|
||||
}
|
||||
|
||||
export function saveAppSettings(v: AppSettings) {
|
||||
localStorage.setItem(KEY, JSON.stringify(v))
|
||||
}
|
||||
Reference in New Issue
Block a user