Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (gotTheLock) {
new MenuManager();

if (checkForUpdateOnLaunchEnabled.value && !IS_DEV) {
checkForUpdate(true);
checkForUpdate(true, false);
}

const { width, height } = savedWindowSize.value;
Expand Down
9 changes: 5 additions & 4 deletions src/helpers/autoUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function setUpdaterSettings(): void {
* Returns true if there is an update.
*/
export async function checkForUpdate(
showNotification: boolean
showUpdateNotification: boolean,
showNoUpdateNotification: boolean
): Promise<boolean> {
setUpdaterSettings();
const results = await autoUpdater.checkForUpdates().catch(() => null);
Expand All @@ -26,7 +27,7 @@ export async function checkForUpdate(
);

isUpdate = results.updateInfo.version > app.getVersion();
if (isUpdate && showNotification) {
if (isUpdate && showUpdateNotification) {
const notification = new Notification({
title: "Update Available",
body:
Expand All @@ -35,7 +36,7 @@ export async function checkForUpdate(
icon: path.resolve(RESOURCES_PATH, "icons", "64x64.png"),
});
notification.show();
} else if (!isUpdate && showNotification) {
} else if (!isUpdate && showNoUpdateNotification) {
const notification = new Notification({
title: "No update found",
icon: path.resolve(RESOURCES_PATH, "icons", "64x64.png"),
Expand All @@ -61,7 +62,7 @@ export async function checkForUpdate(
export async function installUpdate(): Promise<void> {
if (!IS_DEV) {
setUpdaterSettings();
if (await checkForUpdate(false)) {
if (await checkForUpdate(false, false)) {
await autoUpdater.downloadUpdate();
settings.isUpdate.next(false);
autoUpdater.quitAndInstall();
Expand Down
2 changes: 1 addition & 1 deletion src/menu/items/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const checkForUpdatesMenuItem: MenuItemConstructorOptions = {
label: "Check for Updates",
click: () => {
if (!IS_DEV) {
checkForUpdate(true);
checkForUpdate(true, true);
}
},
};
Expand Down