Fixes #112487 - avoid using stale cache for render

This commit is contained in:
Eric Amodio 2021-01-13 02:23:43 -05:00
parent d78fad382a
commit d4be66da20

View file

@ -956,12 +956,12 @@ class ViewModel {
private refresh(item?: IRepositoryItem | IGroupItem): void {
if (!this.alwaysShowRepositories && (this.items.size === 1 && (!item || isRepositoryItem(item)))) {
const item = Iterable.first(this.items.values())!;
this.tree.setChildren(null, this.render(item, this._treeViewState).children);
this.tree.setChildren(null, this.render(item, this.treeViewState).children);
} else if (item) {
this.tree.setChildren(item.element, this.render(item, this._treeViewState).children);
this.tree.setChildren(item.element, this.render(item, this.treeViewState).children);
} else {
const items = coalesce(this.scmViewService.visibleRepositories.map(r => this.items.get(r)));
this.tree.setChildren(null, items.map(item => this.render(item, this._treeViewState)));
this.tree.setChildren(null, items.map(item => this.render(item, this.treeViewState)));
}
this._onDidChangeRepositoryCollapseState.fire();