From e15227aa7c587fe39597e2a2f75de58f0f322aca Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Tue, 24 Aug 2021 17:01:55 -0400 Subject: [PATCH] Remove pending update listeners prior to setting a new one --- ts/updater/common.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/updater/common.ts b/ts/updater/common.ts index 2bd6702fe0b6..e3426e264d9b 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -132,11 +132,11 @@ export async function downloadUpdate( validatePath(tempDir, targetUpdatePath); validatePath(tempDir, targetSignaturePath); - logger.info(`downloadUpdate: Downloading ${signatureUrl}`); + logger.info(`downloadUpdate: Downloading signature ${signatureUrl}`); const { body } = await get(signatureUrl, getGotOptions()); await writeFile(targetSignaturePath, body); - logger.info(`downloadUpdate: Downloading ${updateFileUrl}`); + logger.info(`downloadUpdate: Downloading update ${updateFileUrl}`); const downloadStream = stream(updateFileUrl, getGotOptions()); const writeStream = createWriteStream(targetUpdatePath); @@ -350,6 +350,7 @@ export function getCliOptions(options: ParserConfiguration['options']): T { } export function setUpdateListener(performUpdateCallback: () => void): void { + ipcMain.removeAllListeners('start-update'); ipcMain.once('start-update', performUpdateCallback); }