mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-22 23:53:08 +00:00
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:
@@ -594,6 +594,21 @@ function RootLayoutContent() {
|
||||
logger.info(
|
||||
'[FAST_HYDRATE] Background reconcile: cache updated (store untouched)'
|
||||
);
|
||||
|
||||
// Selectively reconcile event hooks from server.
|
||||
// Unlike projects/theme, eventHooks aren't rendered on the main view,
|
||||
// so updating them won't cause a visible re-render flash.
|
||||
const serverHooks = (finalSettings as GlobalSettings).eventHooks ?? [];
|
||||
const currentHooks = useAppStore.getState().eventHooks;
|
||||
if (
|
||||
JSON.stringify(serverHooks) !== JSON.stringify(currentHooks) &&
|
||||
serverHooks.length > 0
|
||||
) {
|
||||
logger.info(
|
||||
`[FAST_HYDRATE] Reconciling eventHooks from server (server=${serverHooks.length}, store=${currentHooks.length})`
|
||||
);
|
||||
useAppStore.setState({ eventHooks: serverHooks });
|
||||
}
|
||||
} catch (e) {
|
||||
logger.debug('[FAST_HYDRATE] Failed to update cache:', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user