ctor takes a bool, not Direction. But use helper fn instead.

This commit is contained in:
Bruno Windels 2019-06-01 18:20:29 +02:00
parent 2a128ed32c
commit 35d90a8535
2 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ export default class FragmentBoundaryEntry extends BaseEntry {
constructor(fragment, isFragmentStart, fragmentIdComparator) {
super(fragmentIdComparator);
this._fragment = fragment;
// TODO: should isFragmentStart be Direction instead of bool?
this._isFragmentStart = isFragmentStart;
}

View File

@ -70,7 +70,7 @@ export default class TimelineReader {
return [];
}
this._fragmentIdComparer.add(liveFragment);
const liveFragmentEntry = new FragmentBoundaryEntry(liveFragment, Direction.Forward, this._fragmentIdComparer);
const liveFragmentEntry = FragmentBoundaryEntry.end(liveFragment, this._fragmentIdComparer);
const eventKey = new EventKey(liveFragmentEntry.fragmentId, liveFragmentEntry.eventIndex);
const entries = this._readFrom(eventKey, Direction.Backward, amount, txn);
entries.unshift(liveFragmentEntry);