Do not add non-messages to the timeline

This commit is contained in:
Josh Perez 2022-04-07 17:13:58 -04:00 committed by GitHub
parent 19bb3bc994
commit 9ffcd44e6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 10 deletions

View file

@ -227,14 +227,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
}
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<MessageAttributesType> {
}
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 });
}
}