1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Appease the linter

This commit is contained in:
Travis Ralston
2019-03-28 18:34:57 -06:00
committed by Bruno Windels
parent 8a56a5f1ed
commit a54845bf76

View File

@@ -409,14 +409,18 @@ EventTimelineSet.prototype.addEventsToTimeline = function(events, toStartOfTimel
" - joining timeline " + timeline + " to " +
existingTimeline);
if (direction === EventTimeline.BACKWARDS && existingTimeline === this._liveTimeline) {
// Variables to keep the line length limited below.
const existingIsLive = existingTimeline === this._liveTimeline;
const timelineIsLive = timeline === this._liveTimeline;
if (direction === EventTimeline.BACKWARDS && existingIsLive) {
// The live timeline should never be spliced into a non-live position.
console.warn("Refusing to splice live timeline as a backwards timeline");
} else {
timeline.setNeighbouringTimeline(existingTimeline, direction);
}
if (inverseDirection === EventTimeline.BACKWARDS && timeline === this._liveTimeline) {
if (inverseDirection === EventTimeline.BACKWARDS && timelineIsLive) {
// The live timeline should never be spliced into a non-live position.
console.warn("Refusing to splice live timeline as a forwards timeline");
} else {