mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
don't override newly requested ranges when retrying loadattop
This commit is contained in:
parent
9411e6f065
commit
5c40b75eab
@ -50,6 +50,8 @@ export class TimelineViewModel extends ViewModel {
|
|||||||
|
|
||||||
/** if this.tiles is empty, call this with undefined for both startTile and endTile */
|
/** if this.tiles is empty, call this with undefined for both startTile and endTile */
|
||||||
setVisibleTileRange(startTile, endTile) {
|
setVisibleTileRange(startTile, endTile) {
|
||||||
|
// don't clear these once done as they are used to check
|
||||||
|
// for more tiles once loadAtTop finishes
|
||||||
this._requestedStartTile = startTile;
|
this._requestedStartTile = startTile;
|
||||||
this._requestedEndTile = endTile;
|
this._requestedEndTile = endTile;
|
||||||
if (!this._requestScheduled) {
|
if (!this._requestScheduled) {
|
||||||
@ -85,7 +87,9 @@ export class TimelineViewModel extends ViewModel {
|
|||||||
this._topLoadingPromise = null;
|
this._topLoadingPromise = null;
|
||||||
if (!hasReachedEnd) {
|
if (!hasReachedEnd) {
|
||||||
// check if more items need to be loaded by recursing
|
// check if more items need to be loaded by recursing
|
||||||
this.setVisibleTileRange(this._startTile, this._endTile);
|
// use the requested start / end tile,
|
||||||
|
// so we don't end up overwriting a newly requested visible range here
|
||||||
|
this.setVisibleTileRange(this._requestedStartTile, this._requestedEndTile);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (loadTop) {
|
} else if (loadTop) {
|
||||||
|
Loading…
Reference in New Issue
Block a user