1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Only add events if there are some; set the pagination token for faster scrollback

This commit is contained in:
Kegan Dougal
2022-08-10 12:43:47 +01:00
parent 1635ac9971
commit edcef9364c

View File

@@ -445,8 +445,10 @@ export class SlidingSyncSdk {
}
}
timelineEvents = newEvents;
// old events are scrollback, insert them now
room.addEventsToTimeline(oldEvents, true, room.getLiveTimeline());
if (oldEvents.length > 0) {
// old events are scrollback, insert them now
room.addEventsToTimeline(oldEvents, true, room.getLiveTimeline(), roomData.prev_batch);
}
}
const encrypted = this.client.isRoomEncrypted(room.roomId);