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

get state events before we nuke the roomstate

This commit is contained in:
David Baker
2017-07-19 12:00:04 +01:00
parent f4b25b59e5
commit 1ce4977a70

View File

@@ -180,8 +180,6 @@ EventTimelineSet.prototype.resetLiveTimeline = function(
// we just stole it and put it on the new live timeline
// (If we're resetting all timelines, don't bother because the old live
// timeline is about to be thrown away anyway.
this._liveTimeline._startState = new RoomState(this._roomId);
this._liveTimeline._endState = new RoomState(this._roomId);
const evMap = this._liveTimeline.getState(EventTimeline.FORWARDS).events;
const events = [];
for (const evtype in evMap) {
@@ -195,6 +193,8 @@ EventTimelineSet.prototype.resetLiveTimeline = function(
events.push(evMap[evtype][stateKey]);
}
}
this._liveTimeline._startState = new RoomState(this._roomId);
this._liveTimeline._endState = new RoomState(this._roomId);
this._liveTimeline.initialiseState(events);
this._liveTimeline.setPaginationToken(