diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index d8e25122d..533f4695a 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -90,10 +90,11 @@ import { } from '../util/whatTypeOfConversation'; import { SignalService as Proto } from '../protobuf'; import { + getMessagePropStatus, hasErrors, isIncoming, + isStory, isTapToView, - getMessagePropStatus, } from '../state/selectors/message'; import { conversationJobQueue, @@ -1373,7 +1374,9 @@ export class ConversationModel extends window.Backbone // Clear typing indicator for a given contact if we receive a message from them this.clearContactTypingTimer(typingToken); - this.addSingleMessage(message); + if (!isStory(message.attributes)) { + this.addSingleMessage(message); + } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this.debouncedUpdateLastMessage!(); diff --git a/ts/models/messages.ts b/ts/models/messages.ts index d535c1d1a..f77d87674 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -227,14 +227,6 @@ export class MessageModel extends window.Backbone.Model { } notifyRedux(): void { - const { messageChanged } = window.reduxActions.conversations; - - if (messageChanged) { - const conversationId = this.get('conversationId'); - // Note: The clone is important for triggering a re-run of selectors - messageChanged(this.id, conversationId, { ...this.attributes }); - } - const { storyChanged } = window.reduxActions.stories; if (isStory(this.attributes)) { @@ -250,6 +242,17 @@ export class MessageModel extends window.Backbone.Model { } storyChanged(storyData); + + // We don't want messageChanged to run + return; + } + + const { messageChanged } = window.reduxActions.conversations; + + if (messageChanged) { + const conversationId = this.get('conversationId'); + // Note: The clone is important for triggering a re-run of selectors + messageChanged(this.id, conversationId, { ...this.attributes }); } }