Merge pull request #4812 from matrix-org/travis/room-list/previews

Use the correct timeline reference for message previews
pull/21833/head
Travis Ralston 2020-06-22 16:16:13 -06:00 committed by GitHub
commit d61d243284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -78,9 +78,8 @@ export class MessagePreviewStore extends AsyncStoreWithClient<IState> {
}
private generatePreview(room: Room) {
const timeline = room.getLiveTimeline();
if (!timeline) return; // usually only happens in tests
const events = timeline.getEvents();
const events = room.timeline;
if (!events) return; // should only happen in tests
for (let i = events.length - 1; i >= 0; i--) {
if (i === events.length - MAX_EVENTS_BACKWARDS) return; // limit reached