Forward: Ensure we get the latest attachments with hydrated data

This commit is contained in:
Scott Nonnenberg 2022-06-28 14:24:42 -07:00 committed by GitHub
parent 101d53c4ea
commit 6a509bab72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1289,7 +1289,12 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
if (!message) {
throw new Error(`showForwardMessageModal: Message ${messageId} missing!`);
}
const attachments = getAttachmentsForMessage(message.attributes);
// We need to give it a fresh object because it's memoized by the root object!
const rawAttachments = getAttachmentsForMessage({ ...message.attributes });
const attachments = rawAttachments.filter(attachment =>
Boolean(attachment.url)
);
const doForwardMessage = async (
conversationIds: Array<string>,