Forward: Ensure we get the latest attachments with hydrated data

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2022-06-28 14:50:15 -07:00 committed by GitHub
parent f06df9dcac
commit a352907a89
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>,