Skip to content

Commit

Permalink
fix: Run menu bar event listeners asynchronously (#2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
arshxyz authored Dec 14, 2021
1 parent 8920d85 commit d99352a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ui/main/menuBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,13 @@ const createWindowMenu = createSelector(
label: t('menus.downloads'),
checked: currentView === 'downloads',
accelerator: 'CommandOrControl+D',
click: () => {
click: async () => {
const browserWindow = await getRootWindow();

if (!browserWindow.isVisible()) {
browserWindow.showInactive();
}
browserWindow.focus();
dispatch({ type: SIDE_BAR_DOWNLOADS_BUTTON_CLICKED });
},
},
Expand All @@ -502,7 +508,13 @@ const createWindowMenu = createSelector(
label: t('menus.settings'),
checked: currentView === 'settings',
accelerator: 'CommandOrControl+I',
click: () => {
click: async () => {
const browserWindow = await getRootWindow();

if (!browserWindow.isVisible()) {
browserWindow.showInactive();
}
browserWindow.focus();
dispatch({ type: SIDE_BAR_SETTINGS_BUTTON_CLICKED });
},
},
Expand Down

0 comments on commit d99352a

Please sign in to comment.