FIX: Remove incoming messages for read events. (#14352)

This prevents the incoming message banner from showing unnecessarily
when reading a post and then navigating back to the unread list.
This commit is contained in:
Alan Guo Xiang Tan 2021-09-16 11:53:23 +08:00 committed by GitHub
parent e70dd8e89c
commit 98dcbd214c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 16 deletions

View File

@ -152,12 +152,7 @@ const PrivateMessageTopicTrackingState = EmberObject.extend({
case "read":
this._modifyState(message.topic_id, message.payload);
if (
this.filter === UNREAD_FILTER &&
this._shouldDisplayMessageForInbox(message)
) {
this._notifyIncoming(message.topic_id);
}
break;
case "unread":
this._modifyState(message.topic_id, message.payload);
@ -178,6 +173,8 @@ const PrivateMessageTopicTrackingState = EmberObject.extend({
) {
this._notifyIncoming(message.topic_id);
}
break;
}
},

View File

@ -280,16 +280,6 @@ acceptance(
);
};
test("incoming read message on unread filter", async function (assert) {
await visit("/u/charlie/messages/unread");
publishReadToMessageBus({ topicId: 1 });
await visit("/u/charlie/messages/unread"); // wait for re-render
assert.ok(exists(".show-mores"), `displays the topic incoming info`);
});
test("incoming group archive message acted by current user", async function (assert) {
await visit("/u/charlie/messages");