Fix more floating promises (#8460)

This commit is contained in:
Charles Gagnon
2019-11-27 08:04:51 -08:00
committed by GitHub
parent 4145ecfb32
commit 0e9797c394
14 changed files with 84 additions and 90 deletions

View File

@@ -72,12 +72,12 @@ export default class FileBrowserTreeComponent extends ComponentBase implements I
}
}
private handleOnAddFileTree(rootNode: FileNode, selectedNode: FileNode, expandedNodes: FileNode[]) {
this.updateFileTree(rootNode, selectedNode, expandedNodes);
private async handleOnAddFileTree(rootNode: FileNode, selectedNode: FileNode, expandedNodes: FileNode[]): Promise<void> {
await this.updateFileTree(rootNode, selectedNode, expandedNodes);
}
private updateFileTree(rootNode: FileNode, selectedNode: FileNode, expandedNodes: FileNode[]): void {
this._treeView.renderBody(this._treeContainer.nativeElement, rootNode, selectedNode, expandedNodes);
private async updateFileTree(rootNode: FileNode, selectedNode: FileNode, expandedNodes: FileNode[]): Promise<void> {
await this._treeView.renderBody(this._treeContainer.nativeElement, rootNode, selectedNode, expandedNodes);
this._treeView.setVisible(true);
this.layoutTree();
this._changeRef.detectChanges();