mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-03-18 21:50:33 +01:00
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.computeScrollInfo();
|
||||
},
|
||||
replaceWithNewItems: (resp: PaginatedDTO) => {
|
||||
let entriesOnDOM = new Map<string, boolean>();
|
||||
|
||||
@@ -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.
|
||||
public abstract loadMore: (loadAll?: boolean, callback?: (resp?: PaginatedDTO) => void) => void;
|
||||
protected _loadMore = (loadAll: boolean = false, callback?: (resp: PaginatedDTO) => void) => {
|
||||
console.trace("loading more");
|
||||
this._c.loadMoreButtons.forEach((v) => (v.disabled = true));
|
||||
const timeout = setTimeout(() => {
|
||||
this._c.loadMoreButtons.forEach((v) => (v.disabled = false));
|
||||
@@ -530,6 +529,7 @@ export abstract class PaginatedList implements PageEventBindable {
|
||||
this._scroll.lastScrollY = scrollY;
|
||||
// If you've scrolled back up, do nothing
|
||||
if (scrollSpeed < 0) return;
|
||||
if (this._scroll.rowHeight == 0) this.computeScrollInfo();
|
||||
let endIdx = this.maximumItemsToRender(scrollY);
|
||||
|
||||
// Throttling this function means we might not catch up in time if the user scrolls fast,
|
||||
|
||||
Reference in New Issue
Block a user