From 5e20842262eb5c9309a063b5a05a5a39e93f49b1 Mon Sep 17 00:00:00 2001 From: JacobZyy Date: Tue, 19 May 2026 14:15:42 +0800 Subject: [PATCH] fix(hooks): always persist plugin hook config state, even when empty When all plugin hooks are removed (user disables/uninstalls plugins), hooksConfigs becomes an empty array. The previous guard (hooksConfigs.length > 0) skipped setPluginHooksConfigs(), leaving stale plugin hooks active in pendingPluginHooksConfigs. Now we always call setPluginHooksConfigs() so empty configs properly clear the pending state and invalidate the cache. --- src/plugin-handlers/hook-config-handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin-handlers/hook-config-handler.ts b/src/plugin-handlers/hook-config-handler.ts index 8c84e20c2..3b6782b78 100644 --- a/src/plugin-handlers/hook-config-handler.ts +++ b/src/plugin-handlers/hook-config-handler.ts @@ -12,7 +12,7 @@ export function applyHookConfig(params: { count: pluginComponents.hooksConfigs.length, plugins: pluginComponents.plugins.map(p => p.name), }) - - setPluginHooksConfigs(pluginComponents.hooksConfigs) } + + setPluginHooksConfigs(pluginComponents.hooksConfigs) }