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
+4 -2
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);