Skip to content

Commit 0ef5a30

Browse files
simonhampgithub-actions[bot]
authored andcommitted
Build plugin
1 parent 8cba5c8 commit 0ef5a30

File tree

1 file changed

+11
-7
lines changed
  • resources/js/electron-plugin/dist/server/api

1 file changed

+11
-7
lines changed

resources/js/electron-plugin/dist/server/api/menuBar.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ router.post("/hide", (req, res) => {
3636
});
3737
router.post("/create", (req, res) => {
3838
res.sendStatus(200);
39+
if (state.activeMenuBar) {
40+
return;
41+
}
3942
const { width, height, url, label, alwaysOnTop, vibrancy, backgroundColor, transparency, icon, showDockIcon, onlyShowContextMenu, windowPosition, contextMenu, tooltip, resizable, event, } = req.body;
4043
if (onlyShowContextMenu) {
4144
const tray = new Tray(icon || state.icon.replace("icon.png", "IconTemplate.png"));
@@ -70,6 +73,7 @@ router.post("/create", (req, res) => {
7073
showDockIcon,
7174
showOnAllWorkspaces: false,
7275
windowPosition: windowPosition !== null && windowPosition !== void 0 ? windowPosition : "trayCenter",
76+
activateWithApp: false,
7377
browserWindow: {
7478
width,
7579
height,
@@ -110,14 +114,14 @@ router.post("/create", (req, res) => {
110114
]
111115
});
112116
});
113-
if (!onlyShowContextMenu) {
114-
state.activeMenuBar.tray.on("right-click", () => {
115-
notifyLaravel("events", {
116-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarContextMenuOpened"
117-
});
118-
state.activeMenuBar.tray.popUpContextMenu(buildMenu(contextMenu));
117+
state.activeMenuBar.tray.on("right-click", () => {
118+
notifyLaravel("events", {
119+
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarContextMenuOpened"
119120
});
120-
}
121+
if (!onlyShowContextMenu) {
122+
state.activeMenuBar.tray.popUpContextMenu(buildMenu(contextMenu));
123+
}
124+
});
121125
});
122126
});
123127
function buildMenu(contextMenu) {

0 commit comments

Comments
 (0)