From 9df6f209c41226d07eff95caee1f2c4cfb7d3912 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 24 Aug 2022 15:54:54 +1000 Subject: [PATCH] fix: mark message as having attachmnents once data is uploaded this is to make those media visible on the right panel. This only happens for attachments we are sending --- ts/models/message.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts/models/message.ts b/ts/models/message.ts index a51d43427..f93f56573 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -94,6 +94,7 @@ import { } from '../session/apis/open_group_api/sogsv3/knownBlindedkeys'; import { QUOTED_TEXT_MAX_LENGTH } from '../session/constants'; import { ReactionList } from '../types/Reaction'; +import { getAttachmentMetadata } from '../types/message/initializeAttachmentMetadata'; // tslint:disable: cyclomatic-complexity /** @@ -780,6 +781,12 @@ export class MessageModel extends Backbone.Model { const quoteWithData = await loadQuoteData(this.get('quote')); const previewWithData = await loadPreviewData(this.get('preview')); + const { hasAttachments, hasVisualMediaAttachments, hasFileAttachments } = getAttachmentMetadata( + this + ); + this.set({ hasAttachments, hasVisualMediaAttachments, hasFileAttachments }); + await this.commit(); + const conversation = this.getConversation(); let attachmentPromise;