Skip to content

Commit

Permalink
fix(packages/core): menu.ts assumes the client defines a list of note…
Browse files Browse the repository at this point in the history
…books

Fixes #6962
  • Loading branch information
starpit committed Feb 4, 2021
1 parent f750982 commit 36b91c8
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/core/src/main/menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-18 IBM Corporation
* Copyright 2017-21 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -133,7 +133,7 @@ export const install = (createWindow: (executeThisArgvPlease?: string[]) => void
}
]

const menuTemplate: MenuItemConstructorOptions[] = [
const fileMenu: MenuItemConstructorOptions[] = [
{
label: 'File',
submenu: fileMenuItems
Expand All @@ -151,8 +151,10 @@ export const install = (createWindow: (executeThisArgvPlease?: string[]) => void
{ role: 'delete' },
{ role: 'selectAll' }
]
},
}
]

const viewMenu: MenuItemConstructorOptions[] = [
{
label: 'View',
submenu: [
Expand All @@ -171,8 +173,10 @@ export const install = (createWindow: (executeThisArgvPlease?: string[]) => void
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
},
notebookMenuItem,
}
]

const windowMenu: MenuItemConstructorOptions[] = [
{
role: 'window',
submenu: [{ role: 'minimize' }, { role: 'close', accelerator: closeAccelerator }]
Expand All @@ -184,6 +188,11 @@ export const install = (createWindow: (executeThisArgvPlease?: string[]) => void
}
]

const menuTemplate: MenuItemConstructorOptions[] = fileMenu
.concat(viewMenu)
.concat(notebookMenuItem ? [notebookMenuItem] : [])
.concat(windowMenu)

const about: MenuItemConstructorOptions = {
label: `About ${productName}`,
click: () => {
Expand Down

0 comments on commit 36b91c8

Please sign in to comment.