clear insights view before showing error (#1050)

This commit is contained in:
Anthony Dresser
2018-04-06 15:54:18 -07:00
committed by Karl Burtram
parent 596f09f754
commit 86748e6d69

View File

@@ -187,13 +187,14 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
}
private _updateChild(result: SimpleExecuteResult): void {
this.componentHost.viewContainerRef.clear();
if (result.rowCount === 0) {
this.showError(nls.localize('noResults', 'No results to show'));
return;
}
let componentFactory = this._componentFactoryResolver.resolveComponentFactory<IInsightsView>(insightRegistry.getCtorFromId(this._typeKey));
this.componentHost.viewContainerRef.clear();
let componentRef = this.componentHost.viewContainerRef.createComponent(componentFactory);
let componentInstance = componentRef.instance;