Additional fixes for dynamic page loading optimization (#402)
- Update to wabac.js 2.21.1 - Hide 'Show non-seed pages' when doing a dynamic query - bump to 2.3.1
This commit is contained in:
+9
-10
@@ -241,7 +241,9 @@ class Pages extends LitElement {
|
||||
this.showAllPages || !seedPages.length
|
||||
? [...this.collInfo!.pages]
|
||||
: seedPages;
|
||||
this.hasExtraPages = seedPages.length !== this.collInfo!.pages.length;
|
||||
this.hasExtraPages = seedPages.length < this.collInfo!.pages.length;
|
||||
} else {
|
||||
this.hasExtraPages = false;
|
||||
}
|
||||
this.dynamicPageCount = 1;
|
||||
await this.addDynamicPages();
|
||||
@@ -283,6 +285,10 @@ class Pages extends LitElement {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json.pages.length) {
|
||||
this.skipScrollMore = true;
|
||||
}
|
||||
|
||||
const knownPages = new Set();
|
||||
this.filteredPages.forEach((x) => knownPages.add(x.id));
|
||||
|
||||
@@ -334,11 +340,7 @@ class Pages extends LitElement {
|
||||
this.filteredPages = [...this.filteredPages, ...newPages];
|
||||
}
|
||||
|
||||
if (json.total) {
|
||||
this.totalPages = json.total;
|
||||
} else {
|
||||
this.totalPages = this.filteredPages.length;
|
||||
}
|
||||
this.totalPages = this.filteredPages.length;
|
||||
}
|
||||
|
||||
async filterCurated() {
|
||||
@@ -1336,10 +1338,7 @@ class Pages extends LitElement {
|
||||
element.scrollHeight - element.scrollTop - element.clientHeight;
|
||||
if (diff < 40 && !this.skipScrollMore) {
|
||||
this.skipScrollMore = true;
|
||||
if (
|
||||
this.dynamicPagesQuery &&
|
||||
this.filteredPages.length < this.totalPages
|
||||
) {
|
||||
if (this.dynamicPagesQuery) {
|
||||
this.dynamicPageCount += 1;
|
||||
await this.addDynamicPages();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user