1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00
This commit is contained in:
David Baker
2017-07-19 11:56:58 +01:00
parent b33a47e253
commit f4b25b59e5
2 changed files with 10 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ limitations under the License.
const EventEmitter = require("events").EventEmitter;
const utils = require("../utils");
const EventTimeline = require("./event-timeline");
const RoomState = require("./room-state");
// var DEBUG = false;
const DEBUG = true;
@@ -154,7 +155,9 @@ EventTimelineSet.prototype.replaceEventId = function(oldEventId, newEventId) {
*
* @fires module:client~MatrixClient#event:"Room.timelineReset"
*/
EventTimelineSet.prototype.resetLiveTimeline = function(backPaginationToken, forwardPaginationToken) {
EventTimelineSet.prototype.resetLiveTimeline = function(
backPaginationToken, forwardPaginationToken,
) {
// if timeline support is disabled, forget about the old timelines
const resetAllTimelines = !this._timelineSupport || !forwardPaginationToken;
@@ -194,7 +197,9 @@ EventTimelineSet.prototype.resetLiveTimeline = function(backPaginationToken, for
}
this._liveTimeline.initialiseState(events);
this._liveTimeline.setPaginationToken(forwardPaginationToken, EventTimeline.FORWARDS);
this._liveTimeline.setPaginationToken(
forwardPaginationToken, EventTimeline.FORWARDS,
);
}
// make sure we set the pagination token before firing timelineReset,

View File

@@ -210,7 +210,9 @@ Room.prototype.getLiveTimeline = function() {
*/
Room.prototype.resetLiveTimeline = function(backPaginationToken, forwardPaginationToken) {
for (let i = 0; i < this._timelineSets.length; i++) {
this._timelineSets[i].resetLiveTimeline(backPaginationToken, forwardPaginationToken);
this._timelineSets[i].resetLiveTimeline(
backPaginationToken, forwardPaginationToken,
);
}
this._fixUpLegacyTimelineFields();