Refetch repo info when toggling worktree options

This commit is contained in:
Mohamed Boudra
2026-01-23 12:59:13 +07:00
parent cb39f4c5c2
commit f0cafb4607
+5 -1
View File
@@ -259,6 +259,7 @@ export default function HomeScreen() {
retry: false, retry: false,
}); });
const repoInfo = repoInfoQuery.data ?? null; const repoInfo = repoInfoQuery.data ?? null;
const refetchRepoInfo = repoInfoQuery.refetch;
const repoRequestError = repoInfoQuery.error as Error | null; const repoRequestError = repoInfoQuery.error as Error | null;
const repoRequestStatus: "idle" | "loading" | "success" | "error" = const repoRequestStatus: "idle" | "loading" | "success" | "error" =
!shouldInspectRepo || repoAvailabilityError !shouldInspectRepo || repoAvailabilityError
@@ -358,8 +359,11 @@ export default function HomeScreen() {
if (mode !== "attach") { if (mode !== "attach") {
setSelectedWorktreePath(""); setSelectedWorktreePath("");
} }
if (mode !== "none") {
refetchRepoInfo();
}
}, },
[worktreeSlug] [worktreeSlug, refetchRepoInfo]
); );
const validateWorktreeName = useCallback( const validateWorktreeName = useCallback(