Skip to content

Commit

Permalink
Only restart after download completed
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Dec 9, 2022
1 parent 07ceaee commit 0f2b059
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class AppUpdater {
autoUpdater.logger = log;
autoUpdater.allowPrerelease = true;
autoUpdater.channel = store.get('updateChannel');
autoUpdater.autoDownload = false;
}
}

Expand Down Expand Up @@ -243,6 +244,9 @@ app

// Auto-updater
autoUpdater.on('update-available', (info) => {
// For now this can only get triggered if the menu bar
// Check For Updated is used.

const notification = new Notification({
title: 'Update available',
body: `Boson ${info.version} is now available.`,
Expand Down Expand Up @@ -277,7 +281,7 @@ autoUpdater.on('update-available', (info) => {
notification.show();
});

autoUpdater.on('update-available', () => {
autoUpdater.on('update-downloaded', () => {
// We only allow a download if we're ready to intall it, so go for it.
autoUpdater.quitAndInstall();
});
Expand Down

0 comments on commit 0f2b059

Please sign in to comment.