diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index f2669a106..f66dab111 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -1,15 +1,15 @@ | |||
1 | import { remote, shell, clipboard } from 'electron'; | 1 | import { clipboard, remote, shell } from 'electron'; |
2 | import { observable, autorun } from 'mobx'; | 2 | import { autorun, observable } from 'mobx'; |
3 | import { defineMessages } from 'react-intl'; | 3 | import { defineMessages } from 'react-intl'; |
4 | 4 | import { cmdKey, ctrlKey, isMac } from '../environment'; | |
5 | import { isMac, ctrlKey, cmdKey } from '../environment'; | ||
6 | import { workspaceStore } from '../features/workspaces/index'; | ||
7 | import { workspaceActions } from '../features/workspaces/actions'; | ||
8 | import { announcementActions } from '../features/announcements/actions'; | ||
9 | import { announcementsStore } from '../features/announcements'; | 5 | import { announcementsStore } from '../features/announcements'; |
6 | import { announcementActions } from '../features/announcements/actions'; | ||
10 | import { todosStore } from '../features/todos'; | 7 | import { todosStore } from '../features/todos'; |
11 | import { todoActions } from '../features/todos/actions'; | 8 | import { todoActions } from '../features/todos/actions'; |
12 | import { CUSTOM_WEBSITE_ID } from '../features/webControls/constants'; | 9 | import { CUSTOM_WEBSITE_ID } from '../features/webControls/constants'; |
10 | import { workspaceActions } from '../features/workspaces/actions'; | ||
11 | import { workspaceStore } from '../features/workspaces/index'; | ||
12 | |||
13 | 13 | ||
14 | const { app, Menu, dialog } = remote; | 14 | const { app, Menu, dialog } = remote; |
15 | 15 | ||
@@ -806,21 +806,12 @@ export default class FranzMenu { | |||
806 | accelerator: 'CmdOrCtrl+Shift+L', | 806 | accelerator: 'CmdOrCtrl+Shift+L', |
807 | enabled: this.stores.user.isLoggedIn && this.stores.settings.app.lockingFeatureEnabled, | 807 | enabled: this.stores.user.isLoggedIn && this.stores.settings.app.lockingFeatureEnabled, |
808 | click() { | 808 | click() { |
809 | // Disable lock first - otherwise the application might not update correctly | ||
810 | actions.settings.update({ | 809 | actions.settings.update({ |
811 | type: 'app', | 810 | type: 'app', |
812 | data: { | 811 | data: { |
813 | locked: false, | 812 | locked: true, |
814 | }, | 813 | }, |
815 | }); | 814 | }); |
816 | setTimeout(() => { | ||
817 | actions.settings.update({ | ||
818 | type: 'app', | ||
819 | data: { | ||
820 | locked: true, | ||
821 | }, | ||
822 | }); | ||
823 | }, 0); | ||
824 | }, | 815 | }, |
825 | }); | 816 | }); |
826 | 817 | ||
@@ -967,7 +958,7 @@ export default class FranzMenu { | |||
967 | 958 | ||
968 | this.currentTemplate = tpl; | 959 | this.currentTemplate = tpl; |
969 | const menu = Menu.buildFromTemplate(tpl); | 960 | const menu = Menu.buildFromTemplate(tpl); |
970 | const lockedMenu = Menu.buildFromTemplate([]); | 961 | const lockedMenu = new Menu(); |
971 | Menu.setApplicationMenu(this.stores.user.isLoggedIn && this.stores.settings.app.locked ? lockedMenu : menu); | 962 | Menu.setApplicationMenu(this.stores.user.isLoggedIn && this.stores.settings.app.locked ? lockedMenu : menu); |
972 | } | 963 | } |
973 | 964 | ||