forked from mystiq/hydrogen-web
fill top gap instead of loading more events from storage
This commit is contained in:
parent
cf0af775e3
commit
1e4f331989
2 changed files with 10 additions and 1 deletions
|
@ -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 a new issue