Skip to content

Commit

Permalink
Merge pull request #553 from warrenbuckley/bugfix/updatecheck-for-non…
Browse files Browse the repository at this point in the history
…-windowsstore-apps

Remove Check Updates Menu for Windows Store users
  • Loading branch information
Warren Buckley authored Apr 22, 2022
2 parents b30d9f8 + 45bafc9 commit b214cd2
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions LogViewer.Client/src/main/appmenu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, Menu, shell } from "electron";
import { app, BrowserWindow, Menu, MenuItem, shell } from "electron";
import * as file from "./file";
import * as webapi from "./webapi";
import * as updater from "./app-updater";
Expand Down Expand Up @@ -93,6 +93,7 @@ const template: Electron.MenuItemConstructorOptions[] = [
},
{
role: "help",
id: "help",
submenu: [{
label: "Github Repo",
click() {
Expand Down Expand Up @@ -137,12 +138,6 @@ const template: Electron.MenuItemConstructorOptions[] = [
{
label: "About",
role: "about"
},
{
label: "Check for Updates",
click: (menuItem) => {
updater.checkForUpdates(menuItem);
}
}],
}];

Expand Down Expand Up @@ -173,6 +168,18 @@ if (process.platform === 'darwin') {
}

const menu = Menu.buildFromTemplate(template);

const isWindowsStore = process.windowsStore;
if(!isWindowsStore){
let helpMenu = menu.getMenuItemById("help");
helpMenu.submenu.append(new MenuItem({
label: "Check for Updates",
click: (menuItem) => {
updater.checkForUpdates(menuItem);
}
}));
}

Menu.setApplicationMenu(menu);

export function updateMenuEnabledState(menuId: string, enabledState: boolean):void {
Expand Down

0 comments on commit b214cd2

Please sign in to comment.