Archived
Clear stale git diff selection
This commit is contained in:
@@ -19,7 +19,13 @@ export class GitController {
|
|||||||
const status = await api.gitStatus(project.id, workspace.id);
|
const status = await api.gitStatus(project.id, workspace.id);
|
||||||
this.setState({ gitStatus: status, gitStale: false, error: "" });
|
this.setState({ gitStatus: status, gitStale: false, error: "" });
|
||||||
const selectedDiffPath = this.getState().selectedDiffPath;
|
const selectedDiffPath = this.getState().selectedDiffPath;
|
||||||
if (selectedDiffPath !== undefined && status.files.some((file) => file.path === selectedDiffPath)) await this.refreshDiff(selectedDiffPath);
|
if (selectedDiffPath !== undefined) {
|
||||||
|
if (status.files.some((file) => file.path === selectedDiffPath)) await this.refreshDiff(selectedDiffPath);
|
||||||
|
else {
|
||||||
|
this.setState({ selectedDiffPath: undefined, selectedDiff: undefined });
|
||||||
|
this.updateUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.setState({ error: String(error) });
|
this.setState({ error: String(error) });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user