it's entry.entryIndex, not eventIndex, but use helper method instead.

This commit is contained in:
Bruno Windels 2019-06-02 15:15:26 +02:00
parent 674007d892
commit d022608a1a

View file

@ -1,5 +1,4 @@
import { SortedArray } from "../../../observable/index.js"; import { SortedArray } from "../../../observable/index.js";
import EventKey from "./EventKey.js";
import Direction from "./Direction.js"; import Direction from "./Direction.js";
import GapWriter from "./persistence/GapWriter.js"; import GapWriter from "./persistence/GapWriter.js";
import TimelineReader from "./persistence/TimelineReader.js"; import TimelineReader from "./persistence/TimelineReader.js";
@ -52,8 +51,11 @@ export default class Timeline {
return; return;
} }
const firstEntry = this._entriesList.array()[0]; const firstEntry = this._entriesList.array()[0];
const firstKey = new EventKey(firstEntry.fragmentId, firstEntry.eventIndex); const entries = await this._timelineReader.readFrom(
const entries = await this._timelineReader.readFrom(firstKey, Direction.Backward, amount); firstEntry.asEventKey(),
Direction.Backward,
amount
);
this._entriesList.setManySorted(entries); this._entriesList.setManySorted(entries);
} }