mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
Make sure pages loading count is kept in sync
This commit is contained in:
parent
0691e493a5
commit
0a2282f4ba
|
@ -301,7 +301,11 @@ class PostStream extends mixin(Component, evented) {
|
||||||
const twoPagesAway = start - this.constructor.loadCount * 2;
|
const twoPagesAway = start - this.constructor.loadCount * 2;
|
||||||
if (twoPagesAway > this.visibleStart && twoPagesAway >= 0) {
|
if (twoPagesAway > this.visibleStart && twoPagesAway >= 0) {
|
||||||
this.visibleStart = twoPagesAway + this.constructor.loadCount + 1;
|
this.visibleStart = twoPagesAway + this.constructor.loadCount + 1;
|
||||||
|
|
||||||
|
if (this.loadPageTimeouts[twoPagesAway]) {
|
||||||
clearTimeout(this.loadPageTimeouts[twoPagesAway]);
|
clearTimeout(this.loadPageTimeouts[twoPagesAway]);
|
||||||
|
this.pagesLoading--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadPage(start, end);
|
this.loadPage(start, end);
|
||||||
|
@ -319,7 +323,11 @@ class PostStream extends mixin(Component, evented) {
|
||||||
const twoPagesAway = start + this.constructor.loadCount * 2;
|
const twoPagesAway = start + this.constructor.loadCount * 2;
|
||||||
if (twoPagesAway < this.visibleEnd && twoPagesAway <= this.count()) {
|
if (twoPagesAway < this.visibleEnd && twoPagesAway <= this.count()) {
|
||||||
this.visibleEnd = twoPagesAway;
|
this.visibleEnd = twoPagesAway;
|
||||||
|
|
||||||
|
if (this.loadPageTimeouts[twoPagesAway]) {
|
||||||
clearTimeout(this.loadPageTimeouts[twoPagesAway]);
|
clearTimeout(this.loadPageTimeouts[twoPagesAway]);
|
||||||
|
this.pagesLoading--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadPage(start, end, true);
|
this.loadPage(start, end, true);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user