fix: only poll branch search when picker menu is open

Pass enabled: isBranchMenuOpen to gitBranchSearchInfiniteQueryOptions so
the infinite query (with its 60s refetchInterval) is only active while the
branch picker is open. The useEffect prefetch already ensures data is
available for the initial open.
This commit is contained in:
Cursor Agent committed 2026-04-06 16:28:44 +00:00
1 parent 4e80c83f12
commit aad2fb41da
1 file changed
+1
@@ -106,6 +106,7 @@ export function BranchToolbarBranchSelector({
gitBranchSearchInfiniteQueryOptions({
cwd: branchCwd,
query: deferredTrimmedBranchQuery,
enabled: isBranchMenuOpen,
}),
);
const branches = useMemo(