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

@ -504,16 +504,22 @@ class Util {
return null;
}
getFirstVisibleElement(parentNode) {
const visible = this.findVisibleElements(parentNode);
getFirstVisibleElement(parentNode, where) {
let visible = this.findVisibleElements(parentNode);
if (visible) {
visible = visible.filter(where);
}
if (visible && visible.length > 0) {
return visible[0];
}
return null;
}
getLastVisibleElement(parentNode) {
const visible = this.findVisibleElements(parentNode);
getLastVisibleElement(parentNode, where) {
let visible = this.findVisibleElements(parentNode);
if (visible) {
visible = visible.filter(where);
}
if (visible && visible.length > 0) {
return visible[visible.length - 1];
}