feat: add AI insight notification toggle

This commit is contained in:
Jason
2026-05-05 12:08:32 +08:00
parent becec65ee3
commit b4758d690b
6 changed files with 87 additions and 27 deletions

View File

@@ -66,6 +66,7 @@ export const CONFIG_KEYS = {
// 通知
NOTIFICATION_ENABLED: 'notificationEnabled',
AI_INSIGHT_NOTIFICATION_ENABLED: 'aiInsightNotificationEnabled',
NOTIFICATION_POSITION: 'notificationPosition',
NOTIFICATION_FILTER_MODE: 'notificationFilterMode',
NOTIFICATION_FILTER_LIST: 'notificationFilterList',
@@ -1677,6 +1678,15 @@ export async function setNotificationEnabled(enabled: boolean): Promise<void> {
await config.set(CONFIG_KEYS.NOTIFICATION_ENABLED, enabled)
}
export async function getAiInsightNotificationEnabled(): Promise<boolean> {
const value = await config.get(CONFIG_KEYS.AI_INSIGHT_NOTIFICATION_ENABLED)
return value !== false
}
export async function setAiInsightNotificationEnabled(enabled: boolean): Promise<void> {
await config.set(CONFIG_KEYS.AI_INSIGHT_NOTIFICATION_ENABLED, enabled)
}
// 获取通知位置
export async function getNotificationPosition(): Promise<'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'> {
const value = await config.get(CONFIG_KEYS.NOTIFICATION_POSITION)