feat: implement keyword migration functionality and update related components

This commit is contained in:
Linus Rath
2026-03-21 01:58:48 +01:00
parent 2547c10060
commit 2d56cc9be9
6 changed files with 139 additions and 31 deletions
+9
View File
@@ -157,6 +157,7 @@ interface SettingsState {
// Keywords
addKeyword: (keyword: KeywordDefinition) => void;
updateKeyword: (id: string, updates: Partial<Omit<KeywordDefinition, 'id'>>) => void;
renameKeyword: (oldId: string, newKeyword: KeywordDefinition) => void;
removeKeyword: (id: string) => void;
reorderKeywords: (keywords: KeywordDefinition[]) => void;
getKeywordById: (id: string) => KeywordDefinition | undefined;
@@ -389,6 +390,14 @@ export const useSettingsStore = create<SettingsState>()(
});
},
renameKeyword: (oldId: string, newKeyword: KeywordDefinition) => {
set({
emailKeywords: get().emailKeywords.map(k =>
k.id === oldId ? newKeyword : k
),
});
},
removeKeyword: (id: string) => {
set({ emailKeywords: get().emailKeywords.filter(k => k.id !== id) });
},