Skip to content

Commit

Permalink
Ensure attachmentDownloadQueue retains fresh attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-signal committed May 1, 2024
1 parent 8ef0ec7 commit f644ab8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ts/util/attachmentDownloadQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit f644ab8

Please sign in to comment.