From 35d90a8535667f3bcc7184fad3088048e4071b26 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Sat, 1 Jun 2019 18:20:29 +0200 Subject: [PATCH] ctor takes a bool, not Direction. But use helper fn instead. --- src/matrix/room/timeline/entries/FragmentBoundaryEntry.js | 1 + src/matrix/room/timeline/persistence/TimelineReader.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js b/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js index 0a336975..10ae7ec4 100644 --- a/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js +++ b/src/matrix/room/timeline/entries/FragmentBoundaryEntry.js @@ -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; } diff --git a/src/matrix/room/timeline/persistence/TimelineReader.js b/src/matrix/room/timeline/persistence/TimelineReader.js index 0fbc59e6..8f2e5a4d 100644 --- a/src/matrix/room/timeline/persistence/TimelineReader.js +++ b/src/matrix/room/timeline/persistence/TimelineReader.js @@ -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);