From 4676524094ae26c34ab1d074415fa3714d086209 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 26 May 2023 11:00:48 +0200 Subject: [PATCH] FIX: do not attempt to mark as read a staged message (#21764) This has not much impact as it would just be a silent 404 server side, but this is unnecessary work. --- .../assets/javascripts/discourse/components/chat-channel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js index d8f4df63c7d..cd2d59b2ddb 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js @@ -462,7 +462,7 @@ export default class ChatLivePane extends Component { const lastReadId = this.args.channel.currentUserMembership?.lastReadMessageId; let lastUnreadVisibleMessage = this.args.channel.visibleMessages.findLast( - (message) => !lastReadId || message.id > lastReadId + (message) => !message.staged && (!lastReadId || message.id > lastReadId) ); // all intersecting messages are read