Refetch repo info when toggling worktree options
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user