Set attachmentDownloadQueue = undefined on empty

This commit is contained in:
Fedor Indutny 2021-03-15 13:18:25 -07:00 committed by Josh Perez
parent 8ee653f252
commit 59d1159c06

View file

@ -2075,6 +2075,11 @@ export async function startApp(): Promise<void> {
window.Signal.Util.setBatchingStrategy(false); window.Signal.Util.setBatchingStrategy(false);
const attachmentDownloadQueue = window.attachmentDownloadQueue || []; 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 THREE_DAYS_AGO = Date.now() - 3600 * 72 * 1000;
const MAX_ATTACHMENT_MSGS_TO_DOWNLOAD = 250; const MAX_ATTACHMENT_MSGS_TO_DOWNLOAD = 250;
const attachmentsToDownload = attachmentDownloadQueue.filter( const attachmentsToDownload = attachmentDownloadQueue.filter(