Skip to content

Commit

Permalink
Add View on GitHub under Help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncButNeverAwaits authored and sunner committed Mar 23, 2024
1 parent bb68781 commit a616d02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
import installExtension, { VUEJS3_DEVTOOLS } from "electron-devtools-installer";
import fs from "fs";
import path from "path";
import { setMenuItems } from "./menu";
import updateApp from "./update";
const isDevelopment = process.env.NODE_ENV !== "production";

Expand Down Expand Up @@ -417,6 +418,7 @@ app.on("ready", async () => {
}

createWindow();
setMenuItems();
updateApp(mainWindow);
});

Expand Down
19 changes: 19 additions & 0 deletions src/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Menu, MenuItem, shell } from "electron";

export const setMenuItems = () => {
const menu = Menu.getApplicationMenu();
menu.items.forEach((m) => {
if (m.role === "help") {
const submenu = m.submenu;
submenu.append(
new MenuItem({
label: "View on GitHub",
click: () => {
shell.openExternal("https://github.com/sunner/ChatALL");
},
}),
);
}
});
Menu.setApplicationMenu(menu);
};

0 comments on commit a616d02

Please sign in to comment.