fill top gap instead of loading more events from storage

This commit is contained in:
Bruno Windels 2020-08-17 15:13:12 +02:00
parent cf0af775e3
commit 1e4f331989
2 changed files with 10 additions and 1 deletions

View file

@ -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";

View file

@ -44,7 +44,12 @@ export class TimelineViewModel {
// doesn't fill gaps, only loads stored entries/tiles
loadAtTop() {
return this._timeline.loadAtTop(50);
const firstTile = this._tiles.getFirst();
if (firstTile.shape === "gap") {
return firstTile.fill();
} else {
return this._timeline.loadAtTop(50);
}
}
unloadAtTop(tileAmount) {