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:
1 file changed
+1
@@ -106,6 +106,7 @@ export function BranchToolbarBranchSelector({
|
||||
gitBranchSearchInfiniteQueryOptions({
|
||||
cwd: branchCwd,
|
||||
query: deferredTrimmedBranchQuery,
|
||||
enabled: isBranchMenuOpen,
|
||||
}),
|
||||
);
|
||||
const branches = useMemo(
|
||||
|
||||
Reference in new issue
Block a user