mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-19 01:50:51 -05:00
fix(tools): keep Internal Search pinned when sources sync (#14798)
This commit is contained in:
1 parent
c564d334dd
commit
a997e9a1d8
1 file changed
+4
-2
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user