Skip to content

Commit

Permalink
Moving shorthand notation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta committed Feb 6, 2022
1 parent 5caf1b1 commit 46782ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/electron-updater/src/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,14 @@ export abstract class AppUpdater extends EventEmitter {
// noinspection JSUnusedGlobalSymbols
checkForUpdatesAndNotify(downloadNotification?: DownloadNotification): Promise<UpdateCheckResult | null> {
return this.checkForUpdates().then(it => {
const downloadPromise = it?.downloadPromise
if (!it || downloadPromise == null) {
if (!it?.downloadPromise) {
if (this._logger.debug != null) {
this._logger.debug("checkForUpdatesAndNotify called, downloadPromise is null")
}
return it
}

void downloadPromise.then(() => {
void it.downloadPromise.then(() => {
const notificationContent = AppUpdater.formatDownloadNotification(it.updateInfo.version, this.app.name, downloadNotification)
new (require("electron").Notification)(notificationContent).show()
})
Expand Down

0 comments on commit 46782ad

Please sign in to comment.