From 891aabde19e7d4275aabefe22a8f1998c80606e8 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 28 Jul 2023 19:31:28 +0200 Subject: [PATCH] FIX: when using arrow to bottom fetch from newest (#22860) We were attempting to fetch from last read but this is actually complicated to get right when you have a lot unread, as we might still have more to load after this but the last unread id is still the same and would make the user end up in a loop. --- .../assets/javascripts/discourse/components/chat-channel.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js index f261cf52002..8aeb71f6f87 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js @@ -427,9 +427,8 @@ export default class ChatChannel extends Component { @action scrollToLatestMessage() { if (this.messagesLoader.canLoadMoreFuture) { - this.fetchMessages({ fetch_from_last_read: true }); + this.fetchMessages(); } else if (this.messagesManager.messages.length > 0) { - this._ignoreNextScroll = true; this.scrollToBottom(this.scrollable); } }