Skip to content

Commit

Permalink
fix(main): blinking context menu (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov authored Feb 22, 2023
1 parent 458325a commit 23f57c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/services/ipc/context-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,22 @@ export const subscribeToContextMenu = () => {
if (type === 'folder' || type === 'all' || type === 'inbox') {
defaultMenu.forEach(i => {
menu.append(new MenuItem(i))
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
})
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

if (type === 'favorites') {
favoritesMenu.forEach(i => {
menu.append(new MenuItem(i))
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
})
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

if (type === 'trash') {
trashMenu.forEach(i => {
menu.append(new MenuItem(i))
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
})
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

menu.on('menu-will-close', () => {
Expand Down Expand Up @@ -381,22 +381,22 @@ export const subscribeToContextMenu = () => {
if (type === 'folder') {
folderMenu.forEach(i => {
menu.append(new MenuItem(i))
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
})
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

if (type === 'tag') {
tagMenu.forEach(i => {
menu.append(new MenuItem(i))
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
})
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

if (type === 'trash') {
trashMenu.forEach(i => {
menu.append(new MenuItem(i))
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
})
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

menu.on('menu-will-close', () => {
Expand Down

0 comments on commit 23f57c5

Please sign in to comment.