FIX: ensures last read is updated on exit (#26691)
This commit is contained in:
parent
a5ef7b1999
commit
08ff0bac29
|
@ -111,6 +111,7 @@ export default class ChatChannel extends Component {
|
|||
this.#cancelHandlers();
|
||||
removeOnPresenceChange(this.onPresenceChangeCallback);
|
||||
this.subscriptionManager.teardown();
|
||||
this.updateLastReadMessage();
|
||||
}
|
||||
|
||||
@action
|
||||
|
@ -415,15 +416,12 @@ export default class ChatChannel extends Component {
|
|||
}
|
||||
|
||||
schedule("afterRender", () => {
|
||||
let lastFullyVisibleMessageNode = null;
|
||||
|
||||
this.scrollable
|
||||
.querySelectorAll(".chat-message-container")
|
||||
.forEach((item) => {
|
||||
if (checkMessageBottomVisibility(this.scrollable, item)) {
|
||||
lastFullyVisibleMessageNode = item;
|
||||
}
|
||||
});
|
||||
const messages = this.scrollable.querySelectorAll(
|
||||
".chat-message-container"
|
||||
);
|
||||
let lastFullyVisibleMessageNode = Array.from(messages)
|
||||
.reverse()
|
||||
.find((item) => checkMessageBottomVisibility(this.scrollable, item));
|
||||
|
||||
if (!lastFullyVisibleMessageNode) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue