Skip to content

Commit

Permalink
workspace: cleanup workbench state
Browse files Browse the repository at this point in the history
Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Dec 17, 2021
1 parent 89f6897 commit ad52561
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -90,7 +91,7 @@ export class WorkspaceFrontendContribution implements CommandContribution, Keybi
const updateWorkspaceStateKey = () => workspaceStateKey.set(this.updateWorkspaceStateKey());
updateWorkspaceStateKey();

const workbenchStateKey = this.contextKeyService.createKey<WorkspaceState>('workbenchState', 'empty');
const workbenchStateKey = this.contextKeyService.createKey<WorkbenchState>('workbenchState', 'empty');
const updateWorkbenchStateKey = () => workbenchStateKey.set(this.updateWorkbenchStateKey());
updateWorkbenchStateKey();

Expand Down Expand Up @@ -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';
}
Expand Down

0 comments on commit ad52561

Please sign in to comment.