clear token on pagination when events start overlapping

This commit is contained in:
Bruno Windels 2019-06-02 19:28:24 +02:00
parent 0b637f656a
commit 7852f31f7e

View File

@ -64,14 +64,20 @@ export default class GapWriter {
if (neighbourFragmentEntry) { if (neighbourFragmentEntry) {
fragmentEntry.linkedFragmentId = neighbourFragmentEntry.fragmentId; fragmentEntry.linkedFragmentId = neighbourFragmentEntry.fragmentId;
neighbourFragmentEntry.linkedFragmentId = fragmentEntry.fragmentId; neighbourFragmentEntry.linkedFragmentId = fragmentEntry.fragmentId;
// if neighbourFragmentEntry was found, it means the events were overlapping,
// so no pagination should happen anymore.
neighbourFragmentEntry.token = null;
fragmentEntry.token = null;
txn.timelineFragments.update(neighbourFragmentEntry.fragment); txn.timelineFragments.update(neighbourFragmentEntry.fragment);
directionalAppend(entries, neighbourFragmentEntry, direction); directionalAppend(entries, neighbourFragmentEntry, direction);
// update fragmentIdComparer here after linking up fragments // update fragmentIdComparer here after linking up fragments
this._fragmentIdComparer.add(fragmentEntry.fragment); this._fragmentIdComparer.add(fragmentEntry.fragment);
this._fragmentIdComparer.add(neighbourFragmentEntry.fragment); this._fragmentIdComparer.add(neighbourFragmentEntry.fragment);
} } else {
fragmentEntry.token = end; fragmentEntry.token = end;
}
txn.timelineFragments.update(fragmentEntry.fragment); txn.timelineFragments.update(fragmentEntry.fragment);
} }