From 6650197a9a9e4046418e2fdb09095755fe1a6cda Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sun, 19 Jan 2025 17:49:09 -0500 Subject: [PATCH 1/2] feat: launch homepage for linux updates Signed-off-by: Adam Setch --- package.json | 2 +- src/main/menu.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ef2a01df2..277ab40af 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "bugs": { "url": "https://github.com/gitify-app/gitify/issues" }, - "homepage": "https://www.gitify.io/", + "homepage": "https://gitify.io/", "build": { "productName": "Gitify", "appId": "com.electron.gitify", diff --git a/src/main/menu.ts b/src/main/menu.ts index 8e1aeb88b..b0190567c 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -1,6 +1,10 @@ -import { Menu, MenuItem } from 'electron'; +import { Menu, MenuItem, shell } from 'electron'; import { autoUpdater } from 'electron-updater'; import type { Menubar } from 'menubar'; + +const packageJson = require('../../package.json'); + +// import { isMacOS, isWindows } from '../renderer/utils/platform'; import { openLogsDirectory, resetApp, takeScreenshot } from './utils'; export default class MenuBuilder { @@ -18,7 +22,11 @@ export default class MenuBuilder { label: 'Check for updates', enabled: true, click: () => { - autoUpdater.checkForUpdatesAndNotify(); + // if (isMacOS() || isWindows()) { + // autoUpdater.checkForUpdatesAndNotify(); + // } else { + shell.openExternal(packageJson.homepage); + // } }, }); From 2adaa50bbda2cdc1bd2ccda8a16f245d949b6870 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sun, 19 Jan 2025 17:49:24 -0500 Subject: [PATCH 2/2] feat: launch homepage for linux updates Signed-off-by: Adam Setch --- src/main/menu.ts | 15 +++++++-------- src/shared/constants.ts | 4 ++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/menu.ts b/src/main/menu.ts index b0190567c..8579f0df8 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -2,9 +2,8 @@ import { Menu, MenuItem, shell } from 'electron'; import { autoUpdater } from 'electron-updater'; import type { Menubar } from 'menubar'; -const packageJson = require('../../package.json'); - -// import { isMacOS, isWindows } from '../renderer/utils/platform'; +import { isMacOS, isWindows } from '../renderer/utils/platform'; +import { APPLICATION } from '../shared/constants'; import { openLogsDirectory, resetApp, takeScreenshot } from './utils'; export default class MenuBuilder { @@ -22,11 +21,11 @@ export default class MenuBuilder { label: 'Check for updates', enabled: true, click: () => { - // if (isMacOS() || isWindows()) { - // autoUpdater.checkForUpdatesAndNotify(); - // } else { - shell.openExternal(packageJson.homepage); - // } + if (isMacOS() || isWindows()) { + autoUpdater.checkForUpdatesAndNotify(); + } else { + shell.openExternal(APPLICATION.WEBSITE); + } }, }); diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 0e895face..3f516a9f5 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -1,5 +1,9 @@ +const packageJson = require('../../package.json'); + export const APPLICATION = { ID: 'com.electron.gitify', NAME: 'Gitify', + + WEBSITE: packageJson.homepage, };