fix(settings): preserve notification template edits (#2300)

This commit is contained in:
Aman Tahiliani
2026-08-06 21:17:16 +03:00
committed by GitHub
parent fa63866cbb
commit bcc64f7586
3 changed files with 43 additions and 6 deletions
+10 -2
View File
@@ -842,7 +842,9 @@ interface UIStore {
setNotifyOnCompletion: (value: boolean) => void;
setNotifyOnError: (value: boolean) => void;
setNotifyOnQuestion: (value: boolean) => void;
setNotificationTemplates: (templates: UIStore['notificationTemplates']) => void;
setNotificationTemplates: (
templates: UIStore['notificationTemplates'] | ((current: UIStore['notificationTemplates']) => UIStore['notificationTemplates']),
) => void;
setSummarizeLastMessage: (value: boolean) => void;
setSummaryThreshold: (value: number) => void;
setSummaryLength: (value: number) => void;
@@ -2135,7 +2137,13 @@ export const useUIStore = create<UIStore>()(
setNotifyOnCompletion: (value) => { set({ notifyOnCompletion: value }); },
setNotifyOnError: (value) => { set({ notifyOnError: value }); },
setNotifyOnQuestion: (value) => { set({ notifyOnQuestion: value }); },
setNotificationTemplates: (templates) => { set({ notificationTemplates: templates }); },
setNotificationTemplates: (templates) => {
set((state) => ({
notificationTemplates: typeof templates === 'function'
? templates(state.notificationTemplates)
: templates,
}));
},
setSummarizeLastMessage: (value) => { set({ summarizeLastMessage: value }); },
setSummaryThreshold: (value) => { set({ summaryThreshold: value }); },
setSummaryLength: (value) => { set({ summaryLength: value }); },