Fix event hooks not persisting across server syncs (#799)

* Changes from fix/event-hook-persistence

* feat: Add explicit permission escape hatch for clearing eventHooks and improve error handling in UI
This commit is contained in:
gsxdsm
2026-02-22 00:36:08 -08:00
committed by GitHub
parent 629fd24d9f
commit 1d732916f1
7 changed files with 83 additions and 19 deletions

View File

@@ -1415,7 +1415,15 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
},
// Event Hook actions
setEventHooks: (hooks) => set({ eventHooks: hooks }),
setEventHooks: async (hooks) => {
set({ eventHooks: hooks });
try {
const httpApi = getHttpApiClient();
await httpApi.settings.updateGlobal({ eventHooks: hooks });
} catch (error) {
logger.error('Failed to sync event hooks:', error);
}
},
// Claude-Compatible Provider actions (new system)
addClaudeCompatibleProvider: async (provider) => {

View File

@@ -634,7 +634,7 @@ export interface AppActions {
setPromptCustomization: (customization: PromptCustomization) => Promise<void>;
// Event Hook actions
setEventHooks: (hooks: EventHook[]) => void;
setEventHooks: (hooks: EventHook[]) => Promise<void>;
// Claude-Compatible Provider actions (new system)
addClaudeCompatibleProvider: (provider: ClaudeCompatibleProvider) => Promise<void>;