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:
parent
08ff0bac29
commit
a564274ba2
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue