fix(ui): reconcile git state after worktree changes

This commit is contained in:
Iuliia Ivashko
2026-09-04 16:41:39 +03:00
parent bde6fed8a2
commit 94c90a16b6
20 changed files with 438 additions and 165 deletions
@@ -90,12 +90,17 @@ export const WorkStatusPrimaryGroup: React.FC<Props> = ({ sessionId, directory,
}
if (awaitingPostBootstrapStatus) {
let cancelled = false;
void runBackgroundNetworkTask(() => fetchStatus(gitDirectory, git, { silent: true }))
.finally(() => {
void runBackgroundNetworkTask(() => fetchStatus(gitDirectory, git, {
force: true,
silent: true,
throwOnError: true,
}))
.then(() => {
if (!cancelled) {
setPostBootstrapRefreshDirectory((current) => (current === gitDirectory ? null : current));
}
});
})
.catch(() => undefined);
return () => {
cancelled = true;
};