jf_activity: fix infinite load
computeScrollInfo wasn't being called before the first detectScroll call, because there is no search functionality (somehow, i think). Fixed by calling it if _scroll.rowHeight is 0.
This commit is contained in:
@@ -2952,6 +2952,7 @@ class UserInfo extends PaginatedList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._search.setOrdering(Array.from(this.entries.keys()), "Date", true);
|
this._search.setOrdering(Array.from(this.entries.keys()), "Date", true);
|
||||||
|
this.computeScrollInfo();
|
||||||
},
|
},
|
||||||
replaceWithNewItems: (resp: PaginatedDTO) => {
|
replaceWithNewItems: (resp: PaginatedDTO) => {
|
||||||
let entriesOnDOM = new Map<string, boolean>();
|
let entriesOnDOM = new Map<string, boolean>();
|
||||||
|
|||||||
+1
-1
@@ -464,7 +464,6 @@ export abstract class PaginatedList implements PageEventBindable {
|
|||||||
// Loads the next page. If "loadAll", all pages will be loaded until the last is reached.
|
// Loads the next page. If "loadAll", all pages will be loaded until the last is reached.
|
||||||
public abstract loadMore: (loadAll?: boolean, callback?: (resp?: PaginatedDTO) => void) => void;
|
public abstract loadMore: (loadAll?: boolean, callback?: (resp?: PaginatedDTO) => void) => void;
|
||||||
protected _loadMore = (loadAll: boolean = false, callback?: (resp: PaginatedDTO) => void) => {
|
protected _loadMore = (loadAll: boolean = false, callback?: (resp: PaginatedDTO) => void) => {
|
||||||
console.trace("loading more");
|
|
||||||
this._c.loadMoreButtons.forEach((v) => (v.disabled = true));
|
this._c.loadMoreButtons.forEach((v) => (v.disabled = true));
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
this._c.loadMoreButtons.forEach((v) => (v.disabled = false));
|
this._c.loadMoreButtons.forEach((v) => (v.disabled = false));
|
||||||
@@ -530,6 +529,7 @@ export abstract class PaginatedList implements PageEventBindable {
|
|||||||
this._scroll.lastScrollY = scrollY;
|
this._scroll.lastScrollY = scrollY;
|
||||||
// If you've scrolled back up, do nothing
|
// If you've scrolled back up, do nothing
|
||||||
if (scrollSpeed < 0) return;
|
if (scrollSpeed < 0) return;
|
||||||
|
if (this._scroll.rowHeight == 0) this.computeScrollInfo();
|
||||||
let endIdx = this.maximumItemsToRender(scrollY);
|
let endIdx = this.maximumItemsToRender(scrollY);
|
||||||
|
|
||||||
// Throttling this function means we might not catch up in time if the user scrolls fast,
|
// Throttling this function means we might not catch up in time if the user scrolls fast,
|
||||||
|
|||||||
Reference in New Issue
Block a user