From ad525613efdc3183749c52de48b1e165abd648bc Mon Sep 17 00:00:00 2001 From: vince-fugnitto Date: Thu, 16 Dec 2021 12:55:04 -0500 Subject: [PATCH] workspace: cleanup workbench state Signed-off-by: vince-fugnitto --- .../src/browser/workspace-frontend-contribution.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/workspace/src/browser/workspace-frontend-contribution.ts b/packages/workspace/src/browser/workspace-frontend-contribution.ts index c9c8b400869aa..dbbd2aac93630 100644 --- a/packages/workspace/src/browser/workspace-frontend-contribution.ts +++ b/packages/workspace/src/browser/workspace-frontend-contribution.ts @@ -51,6 +51,7 @@ export enum WorkspaceStates { folder = 'folder', }; export type WorkspaceState = keyof typeof WorkspaceStates; +export type WorkbenchState = keyof typeof WorkspaceStates; @injectable() export class WorkspaceFrontendContribution implements CommandContribution, KeybindingContribution, MenuContribution, FrontendApplicationContribution { @@ -90,7 +91,7 @@ export class WorkspaceFrontendContribution implements CommandContribution, Keybi const updateWorkspaceStateKey = () => workspaceStateKey.set(this.updateWorkspaceStateKey()); updateWorkspaceStateKey(); - const workbenchStateKey = this.contextKeyService.createKey('workbenchState', 'empty'); + const workbenchStateKey = this.contextKeyService.createKey('workbenchState', 'empty'); const updateWorkbenchStateKey = () => workbenchStateKey.set(this.updateWorkbenchStateKey()); updateWorkbenchStateKey(); @@ -500,14 +501,14 @@ export class WorkspaceFrontendContribution implements CommandContribution, Keybi } protected updateWorkspaceStateKey(): WorkspaceState { - return this.doUpdateWorkspaceState(); + return this.doUpdateState(); } - protected updateWorkbenchStateKey(): WorkspaceState { - return this.doUpdateWorkspaceState(); + protected updateWorkbenchStateKey(): WorkbenchState { + return this.doUpdateState(); } - protected doUpdateWorkspaceState(): WorkspaceState { + protected doUpdateState(): WorkspaceState | WorkbenchState { if (this.workspaceService.opened) { return this.workspaceService.isMultiRootWorkspaceOpened ? 'workspace' : 'folder'; }