diff --git a/packages/app/src/components/explorer-sidebar.tsx b/packages/app/src/components/explorer-sidebar.tsx index 36a660b1c..6357616c3 100644 --- a/packages/app/src/components/explorer-sidebar.tsx +++ b/packages/app/src/components/explorer-sidebar.tsx @@ -262,13 +262,14 @@ function SidebarContent({ const { theme } = useUnistyles(); const { status } = useCheckoutStatusQuery({ serverId, cwd }); const isGit = status?.isGit ?? false; + const hasResolvedCheckoutStatus = status !== null; // Switch to Files tab if Changes tab is hidden and user was on it useEffect(() => { - if (!isGit && activeTab === "changes") { + if (hasResolvedCheckoutStatus && !isGit && activeTab === "changes") { onTabPress("files"); } - }, [isGit, activeTab, onTabPress]); + }, [hasResolvedCheckoutStatus, isGit, activeTab, onTabPress]); return (