diff --git a/ts/updater/common.ts b/ts/updater/common.ts index 2c3090d65..264929d43 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -109,7 +109,9 @@ export abstract class Updater { protected readonly getMainWindow: () => BrowserWindow | undefined; - private throttledSendDownloadingUpdate: (downloadedSize: number) => void; + private throttledSendDownloadingUpdate: ((downloadedSize: number) => void) & { + cancel: () => void; + }; private activeDownload: Promise | undefined; @@ -135,7 +137,7 @@ export abstract class Updater { DialogType.Downloading, { downloadedSize } ); - }, 500); + }, 50); } // @@ -381,7 +383,7 @@ export abstract class Updater { this.logger.warn( 'offerUpdate: Failed to download differential update, offering full' ); - + this.throttledSendDownloadingUpdate.cancel(); return this.offerUpdate(updateInfo, DownloadMode.FullOnly, attempt + 1); }