diff --git a/frontend/src/components/repo/BranchSwitcher.tsx b/frontend/src/components/repo/BranchSwitcher.tsx
index a5e3aca5..a0104a7c 100644
--- a/frontend/src/components/repo/BranchSwitcher.tsx
+++ b/frontend/src/components/repo/BranchSwitcher.tsx
@@ -34,8 +34,8 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep
const { data: branches, isLoading: branchesLoading, refetch: refetchBranches } = useQuery({
queryKey: ["branches", repoId],
queryFn: () => listBranches(repoId),
- enabled: !!repoId,
- staleTime: 1000 * 30,
+ enabled: false,
+ staleTime: Infinity,
});
const activeBranch = branches?.current ?? currentBranch;
@@ -63,7 +63,7 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep
},
});
- const showLoading = switchBranchMutation.isPending || branchesLoading;
+ const showLoading = switchBranchMutation.isPending || (branchesLoading && !branches);
return (
<>
@@ -110,7 +110,7 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep
>
) : (
<>
- {branchesLoading ? (
+ {branchesLoading && !branches ? (
- No repositories found matching "{searchQuery}" -
-+ No repositories found matching "{searchQuery}" +
+