From 59d1159c0655a6825da60935804c5d30067f45f3 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Mon, 15 Mar 2021 13:18:25 -0700 Subject: [PATCH] Set `attachmentDownloadQueue = undefined` on empty --- ts/background.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ts/background.ts b/ts/background.ts index b827ab48d..936c70372 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2075,6 +2075,11 @@ export async function startApp(): Promise { window.Signal.Util.setBatchingStrategy(false); const attachmentDownloadQueue = window.attachmentDownloadQueue || []; + + // NOTE: ts/models/messages.ts expects this global to become undefined + // once we stop processing the queue. + window.attachmentDownloadQueue = undefined; + const THREE_DAYS_AGO = Date.now() - 3600 * 72 * 1000; const MAX_ATTACHMENT_MSGS_TO_DOWNLOAD = 250; const attachmentsToDownload = attachmentDownloadQueue.filter(