From a54845bf76d58b2aa935389ca12be3e82830e79f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 28 Mar 2019 18:34:57 -0600 Subject: [PATCH] Appease the linter --- src/models/event-timeline-set.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/models/event-timeline-set.js b/src/models/event-timeline-set.js index c3d006468..b8ea153ab 100644 --- a/src/models/event-timeline-set.js +++ b/src/models/event-timeline-set.js @@ -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 {