Fix flash of 'Initialize git' when switching branch/worktree

branchesQuery.data is undefined while loading, so isRepo defaulted to
false — briefly showing the init button even for worktrees. Now defaults
to true while loading (only shows init when the query actually returns
isRepo: false).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Opus 4.6 committed 2026-02-11 15:41:27 -08:00
1 parent d6ecf15805
commit cf66f53a55
1 file changed
+3 -1
+3 -1
View File
@@ -37,7 +37,9 @@ export default function BranchToolbar({ envMode, onEnvModeChange, envLocked }: B
});
const branches = branchesQuery.data?.branches ?? [];
const isRepo = branchesQuery.data?.isRepo ?? false;
// Default to true while loading — showing "Initialize git" during a fetch is wrong,
// and worktrees are inherently git repos.
const isRepo = branchesQuery.data?.isRepo ?? !branchesQuery.isLoading;
// ── Mutations ─────────────────────────────────────────────────────────