don't assume there is at least 1 tile before loading at top

it can happen that all tiles are not renderable, and we should just
keep calling loadAtTop
This commit is contained in:
Bruno Windels 2021-06-03 09:25:56 +02:00
parent 711b5be07f
commit b83613924c

View file

@ -52,7 +52,7 @@ export class TimelineViewModel extends ViewModel {
return true;
}
const firstTile = this._tiles.getFirst();
if (firstTile.shape === "gap") {
if (firstTile?.shape === "gap") {
return await firstTile.fill();
} else {
const topReached = await this._timeline.loadAtTop(10);