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) {
fragmentEntry.linkedFragmentId = neighbourFragmentEntry.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);
directionalAppend(entries, neighbourFragmentEntry, direction);
// update fragmentIdComparer here after linking up fragments
this._fragmentIdComparer.add(fragmentEntry.fragment);
this._fragmentIdComparer.add(neighbourFragmentEntry.fragment);
}
} else {
fragmentEntry.token = end;
}
txn.timelineFragments.update(fragmentEntry.fragment);
}