empty view: dispose listener

This commit is contained in:
isidor 2017-11-17 10:43:32 +01:00
parent 8f47d31d32
commit 738d907bda

View file

@ -57,8 +57,7 @@ export class EmptyView extends ViewsViewletPanel {
this.button = new Button(section);
attachButtonStyler(this.button, this.themeService);
// TODO@isidor: need to dispose this listener
this.button.onDidClick(() => {
this.disposables.push(this.button.onDidClick(() => {
const actionClass = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? AddRootFolderAction : env.isMacintosh ? OpenFileFolderAction : OpenFolderAction;
const action = this.instantiationService.createInstance<string, string, IAction>(actionClass, actionClass.ID, actionClass.LABEL);
this.actionRunner.run(action).done(() => {
@ -67,7 +66,7 @@ export class EmptyView extends ViewsViewletPanel {
action.dispose();
errors.onUnexpectedError(err);
});
});
}));
this.setLabels();
}