Skip to content

Commit

Permalink
feat: move "Open Developer Tools of Active Workspace" out of submenu,…
Browse files Browse the repository at this point in the history
… because I don't have good method to update submenu
  • Loading branch information
linonetwo committed Jun 23, 2021
1 parent caf26cd commit 283a326
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/services/workspacesView/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,15 @@ export class WorkspaceView implements IWorkspaceViewService {
}

private async registerMenu(): Promise<void> {
const hasWorkspaces = (await this.workspaceService.countWorkspaces()) > 0;
await this.menuService.insertMenu('Workspaces', [
{
label: () => i18n.t('Preference.DeveloperTools'),
submenu: [
{
label: 'Open Developer Tools of Active Workspace',
accelerator: 'CmdOrCtrl+Option+I',
click: async () => (await this.viewService.getActiveBrowserView())?.webContents?.openDevTools(),
enabled: hasWorkspaces,
},
],
label: () => i18n.t('Menu.DeveloperToolsActiveWorkspace'),
accelerator: 'CmdOrCtrl+Option+I',
click: async () => (await this.viewService.getActiveBrowserView())?.webContents?.openDevTools(),
enabled: async () => {
const hasWorkspaces = (await this.workspaceService.countWorkspaces()) > 0;
return hasWorkspaces;
},
},
]);
}
Expand Down

0 comments on commit 283a326

Please sign in to comment.