mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
fill top gap instead of loading more events from storage
This commit is contained in:
parent
cf0af775e3
commit
1e4f331989
@ -201,6 +201,10 @@ export class TilesCollection extends BaseObservableList {
|
||||
get length() {
|
||||
return this._tiles.length;
|
||||
}
|
||||
|
||||
getFirst() {
|
||||
return this._tiles[0];
|
||||
}
|
||||
}
|
||||
|
||||
import {ObservableArray} from "../../../../observable/list/ObservableArray.js";
|
||||
|
@ -44,8 +44,13 @@ export class TimelineViewModel {
|
||||
|
||||
// doesn't fill gaps, only loads stored entries/tiles
|
||||
loadAtTop() {
|
||||
const firstTile = this._tiles.getFirst();
|
||||
if (firstTile.shape === "gap") {
|
||||
return firstTile.fill();
|
||||
} else {
|
||||
return this._timeline.loadAtTop(50);
|
||||
}
|
||||
}
|
||||
|
||||
unloadAtTop(tileAmount) {
|
||||
// get lowerSortKey for tile at index tileAmount - 1
|
||||
|
Loading…
Reference in New Issue
Block a user