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

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>,