Skip to content

Commit

Permalink
fix(electron-updater): downloading builds(updates) more than once eve…
Browse files Browse the repository at this point in the history
…n if downloaded already

Close #3007, Close #3003
  • Loading branch information
developeryashraj authored and develar committed Jun 24, 2018
1 parent 0cdb1c4 commit 6500b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/electron-updater/src/DownloadedUpdateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export class DownloadedUpdateHelper {
}

async validateDownloadedPath(updateFile: string, versionInfo: UpdateInfo, fileInfo: ResolvedUpdateFileInfo, logger: Logger): Promise<boolean> {
if (this.versionInfo != null && this.file === updateFile) {
if (this.versionInfo != null && this.file === updateFile && this.fileInfo != null) {
// update has already been downloaded from this running instance
// check here only existence, not checksum
return isEqual(this.versionInfo, versionInfo) && isEqual(this.fileInfo, fileInfo) && (await pathExists(updateFile))
return isEqual(this.versionInfo, versionInfo) && isEqual(this.fileInfo.info, fileInfo.info) && (await pathExists(updateFile))
}

// update has already been downloaded from some previous app launch
Expand Down

0 comments on commit 6500b35

Please sign in to comment.