Fix room list sorted by recent on app startup (#9515)

pull/28788/head^2
Germain 2022-10-28 10:53:50 +01:00 committed by GitHub
parent c497046e39
commit 750ca78e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ const getLastTs = (r: Room, userId: string) => {
const threadLastEventTimestamps = r.getThreads().map(thread => { const threadLastEventTimestamps = r.getThreads().map(thread => {
const event = thread.replyToEvent ?? thread.rootEvent; const event = thread.replyToEvent ?? thread.rootEvent;
return event!.getTs(); return event?.getTs() ?? 0;
}); });
return Math.max(mainTimelineLastTs, ...threadLastEventTimestamps); return Math.max(mainTimelineLastTs, ...threadLastEventTimestamps);