Skip to content

Commit

Permalink
Attach event listener before downloading
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Malton <sebastian@malton.name>
  • Loading branch information
Nokel81 committed Nov 8, 2021
1 parent 35929bc commit 3108cd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/electron-updater/src/MacUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ export class MacUpdater extends AppUpdater {
// update already fetched by Squirrel, it's ready to install
this.nativeUpdater.quitAndInstall()
} else {
// Quit and install as soon as Squirrel get the update
this.nativeUpdater.on("update-downloaded", () => {
this.nativeUpdater.quitAndInstall()
})

if (!this.autoInstallOnAppQuit) {
/**
* If this was not `true` previously then MacUpdater.doDownloadUpdate()
* would not actually initiate the downloading by electron's autoUpdater
*/
this.nativeUpdater.checkForUpdates();
this.nativeUpdater.checkForUpdates()
}

// Quit and install as soon as Squirrel get the update
this.nativeUpdater.on("update-downloaded", () => {
this.nativeUpdater.quitAndInstall()
})
}
}
}

0 comments on commit 3108cd7

Please sign in to comment.