Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 94ce1d2

Browse files
authored
Merge pull request #14 from bbredewold/main
Add endpoint to update the context-menu
2 parents b3982a6 + fa3a5aa commit 94ce1d2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

dist/server/api/menuBar.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ router.post("/label", (req, res) => {
1515
const { label } = req.body;
1616
state_1.default.activeMenuBar.tray.setTitle(label);
1717
});
18+
router.post("/context-menu", (req, res) => {
19+
res.sendStatus(200);
20+
const { contextMenu } = req.body;
21+
state_1.default.activeMenuBar.tray.setContextMenu(buildMenu(contextMenu));
22+
});
1823
router.post("/show", (req, res) => {
1924
res.sendStatus(200);
2025
state_1.default.activeMenuBar.showWindow();

src/server/api/menuBar.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ router.post("/label", (req, res) => {
1616
state.activeMenuBar.tray.setTitle(label);
1717
});
1818

19+
router.post("/context-menu", (req, res) => {
20+
res.sendStatus(200);
21+
const { contextMenu } = req.body;
22+
23+
state.activeMenuBar.tray.setContextMenu(buildMenu(contextMenu));
24+
});
25+
1926
router.post("/show", (req, res) => {
2027
res.sendStatus(200);
2128

0 commit comments

Comments
 (0)