Fix lazy loading on the genre pages (#6799)

* Fix genre tab from sorting shows randomly

* Fix loading elements that have already been loaded

* Fix lazyLoader for show and movie genre tabs

* Reduce time window in which callback may be executed again
This commit is contained in:
Nicholas Jorgenson
2025-04-29 16:06:43 -04:00
committed by GitHub
parent da7135e77a
commit d190fdb27c
3 changed files with 18 additions and 6 deletions
@@ -7,10 +7,10 @@ export class LazyLoader {
createObserver() {
const callback = this.options.callback;
const observer = new IntersectionObserver(
(entries) => {
const newObserver = new IntersectionObserver(
(entries, observer) => {
entries.forEach(entry => {
callback(entry);
callback(entry, observer);
});
},
{
@@ -18,7 +18,7 @@ export class LazyLoader {
threshold: 0
});
this.observer = observer;
this.observer = newObserver;
}
addElements(elements) {