Fix explorer tab fallback when checkout status is unresolved
This commit is contained in:
@@ -262,13 +262,14 @@ function SidebarContent({
|
|||||||
const { theme } = useUnistyles();
|
const { theme } = useUnistyles();
|
||||||
const { status } = useCheckoutStatusQuery({ serverId, cwd });
|
const { status } = useCheckoutStatusQuery({ serverId, cwd });
|
||||||
const isGit = status?.isGit ?? false;
|
const isGit = status?.isGit ?? false;
|
||||||
|
const hasResolvedCheckoutStatus = status !== null;
|
||||||
|
|
||||||
// Switch to Files tab if Changes tab is hidden and user was on it
|
// Switch to Files tab if Changes tab is hidden and user was on it
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isGit && activeTab === "changes") {
|
if (hasResolvedCheckoutStatus && !isGit && activeTab === "changes") {
|
||||||
onTabPress("files");
|
onTabPress("files");
|
||||||
}
|
}
|
||||||
}, [isGit, activeTab, onTabPress]);
|
}, [hasResolvedCheckoutStatus, isGit, activeTab, onTabPress]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.sidebarContent} pointerEvents="auto">
|
<View style={styles.sidebarContent} pointerEvents="auto">
|
||||||
|
|||||||
Reference in New Issue
Block a user