dont dispose serverTreeView every time hidden (#5092)

This commit is contained in:
Aditya Bist
2019-04-17 20:12:44 -07:00
committed by GitHub
parent d3483afaed
commit 1fec26c6b3
2 changed files with 9 additions and 6 deletions

View File

@@ -56,10 +56,12 @@ export class ConnectionViewletPanel extends ViewletPanel {
this._addServerGroupAction = this.instantiationService.createInstance(AddServerGroupAction,
AddServerGroupAction.ID,
AddServerGroupAction.LABEL);
this._serverTreeView = this.instantiationService.createInstance(ServerTreeView);
this._serverTreeView = this.objectExplorerService.getServerTreeView();
if (!this._serverTreeView) {
this._serverTreeView = this.instantiationService.createInstance(ServerTreeView);
this.objectExplorerService.registerServerTreeView(this._serverTreeView);
}
this._activeConnectionsFilterAction = this._serverTreeView.activeConnectionsFilterAction;
this.objectExplorerService.registerServerTreeView(this._serverTreeView);
}
protected renderHeader(container: HTMLElement): void {
@@ -127,9 +129,8 @@ export class ConnectionViewletPanel extends ViewletPanel {
}
dispose(): void {
this._serverTreeView.dispose();
super.dispose();
this.disposables = dispose(this.disposables);
super.dispose();
}
focus(): void {

View File

@@ -117,7 +117,9 @@ export class DataExplorerViewlet extends ViewContainerViewlet {
}
protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewletPanel {
return this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewletPanel;
let viewletPanel = this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewletPanel;
this._register(viewletPanel);
return viewletPanel;
}
dispose(): void {