浏览代码

Forces reset on clear

Avoids saving/re-saving object if it isn't changing
main
Eric Amodio 2 年前
父节点
当前提交
1fc4d399ef
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      src/views/nodes/compareBranchNode.ts

+ 4
- 2
src/views/nodes/compareBranchNode.ts 查看文件

@ -181,8 +181,6 @@ export class CompareBranchNode extends ViewNode
@log()
async clear() {
if (this._compareWith == null) return;
this._compareWith = undefined;
await this.updateCompareWith(undefined);
@ -354,6 +352,8 @@ export class CompareBranchNode extends ViewNode
WorkspaceState.BranchComparisons,
);
if (comparisons == null) {
if (compareWith == null) return;
comparisons = Object.create(null) as BranchComparisons;
}
@ -362,6 +362,8 @@ export class CompareBranchNode extends ViewNode
if (compareWith != null) {
comparisons[id] = { ...compareWith };
} else {
if (comparisons[id] == null) return;
const { [id]: _, ...rest } = comparisons;
comparisons = rest;
}

正在加载...
取消
保存