Ensure attachmentDownloadQueue retains fresh attributes

This commit is contained in:
trevor-signal 2024-05-01 15:22:06 -04:00 committed by GitHub
parent 8ef0ec706d
commit f644ab8a01
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) => {