FIX: messages are already reversed (#26692)

This is reverting part of 08ff0bac29 to only have the call on exit channel. This was causing incorrect unread update. I will refactor this in another commit.
This commit is contained in:
Joffrey JAFFEUX 2024-04-20 12:33:09 +02:00 committed by GitHub
parent 08ff0bac29
commit a564274ba2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 6 deletions

View File

@ -416,12 +416,15 @@ export default class ChatChannel extends Component {
} }
schedule("afterRender", () => { schedule("afterRender", () => {
const messages = this.scrollable.querySelectorAll( let lastFullyVisibleMessageNode = null;
".chat-message-container"
); this.scrollable
let lastFullyVisibleMessageNode = Array.from(messages) .querySelectorAll(".chat-message-container")
.reverse() .forEach((item) => {
.find((item) => checkMessageBottomVisibility(this.scrollable, item)); if (checkMessageBottomVisibility(this.scrollable, item)) {
lastFullyVisibleMessageNode = item;
}
});
if (!lastFullyVisibleMessageNode) { if (!lastFullyVisibleMessageNode) {
return; return;