fix(tools): keep Internal Search pinned when sources sync (#14798)

This commit is contained in:
Raunak Bhagat authored and GitHub committed 2026-09-16 18:21:13 +00:00
1 parent c564d334dd
commit a997e9a1d8
1 file changed
+4 -2
+4 -2
View File
@@ -139,8 +139,10 @@ function useToolsPopoverState({
const setSearchToolEnabled = useCallback(
(enabled: boolean) => {
if (searchToolId === null) return;
toolConfiguration.setToolState(searchToolId, () =>
enabled ? null : "disabled"
// Enabling only lifts the disabled flag. Writing null here would erase
// a "forced" pin, since this runs again on every configuration change.
toolConfiguration.setToolState(searchToolId, (current) =>
enabled ? (current === "disabled" ? null : current) : "disabled"
);
},
[searchToolId, toolConfiguration]