Skip to content

Commit

Permalink
✨ Add exit to tray menu
Browse files Browse the repository at this point in the history
  • Loading branch information
lmachens committed Dec 22, 2021
1 parent aa24962 commit 4bd6567
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,19 @@ const createWindow = () => {
win.webContents.send("open", website);
},
}));
const contextMenu = Menu.buildFromTemplate(template);
const alwaysVisible = [
{
type: "separator",
},
{
label: "Exit",
type: "normal",
click: () => {
app.exit();
},
},
];
const contextMenu = Menu.buildFromTemplate([...template, ...alwaysVisible]);
tray.setContextMenu(contextMenu);
});
};
Expand Down

0 comments on commit 4bd6567

Please sign in to comment.