Ensure attachmentDownloadQueue retains fresh attributes

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-05-01 15:07:17 -05:00 committed by GitHub
parent 0c301b68ab
commit 730517fd72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,7 +66,11 @@ export async function flushAttachmentDownloadQueue(): Promise<void> {
);
const messagesWithDownloads = await Promise.all(
attachmentsToDownload.map(message => message.queueAttachmentDownloads())
attachmentsToDownload.map(message => {
const updatedMessage =
window.MessageCache.__DEPRECATED$getById(message.id) ?? message;
return updatedMessage.queueAttachmentDownloads();
})
);
const messagesToSave: Array<MessageAttributesType> = [];
messagesWithDownloads.forEach((shouldSave, messageKey) => {