Make sure read marker is updated correctly

This commit is contained in:
N Pex 2023-02-28 10:29:53 +00:00
parent c82c02b39b
commit 613f4e23aa
5 changed files with 38 additions and 8 deletions

View file

@ -528,7 +528,7 @@ export default {
if (!this.$config.experimental_voice_mode) return false;
return util.useVoiceMode(this.room);
},
}
},
},
watch: {
@ -1316,8 +1316,8 @@ export default {
let eventIdLast = null;
if (!this.useVoiceMode) {
const container = this.chatContainer;
const elFirst = util.getFirstVisibleElement(container);
const elLast = util.getLastVisibleElement(container);
const elFirst = util.getFirstVisibleElement(container, (item) => item.hasAttribute("eventId"));
const elLast = util.getLastVisibleElement(container, (item) => item.hasAttribute("eventId"));
if (elFirst && elLast) {
eventIdFirst = elFirst.getAttribute("eventId");
eventIdLast = elLast.getAttribute("eventId");