Skip to content

Commit 2adaa50

Browse files
committed
feat: launch homepage for linux updates
Signed-off-by: Adam Setch <[email protected]>
1 parent 6650197 commit 2adaa50

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/main/menu.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { Menu, MenuItem, shell } from 'electron';
22
import { autoUpdater } from 'electron-updater';
33
import type { Menubar } from 'menubar';
44

5-
const packageJson = require('../../package.json');
6-
7-
// import { isMacOS, isWindows } from '../renderer/utils/platform';
5+
import { isMacOS, isWindows } from '../renderer/utils/platform';
6+
import { APPLICATION } from '../shared/constants';
87
import { openLogsDirectory, resetApp, takeScreenshot } from './utils';
98

109
export default class MenuBuilder {
@@ -22,11 +21,11 @@ export default class MenuBuilder {
2221
label: 'Check for updates',
2322
enabled: true,
2423
click: () => {
25-
// if (isMacOS() || isWindows()) {
26-
// autoUpdater.checkForUpdatesAndNotify();
27-
// } else {
28-
shell.openExternal(packageJson.homepage);
29-
// }
24+
if (isMacOS() || isWindows()) {
25+
autoUpdater.checkForUpdatesAndNotify();
26+
} else {
27+
shell.openExternal(APPLICATION.WEBSITE);
28+
}
3029
},
3130
});
3231

src/shared/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
const packageJson = require('../../package.json');
2+
13
export const APPLICATION = {
24
ID: 'com.electron.gitify',
35

46
NAME: 'Gitify',
7+
8+
WEBSITE: packageJson.homepage,
59
};

0 commit comments

Comments
 (0)