Filter empty threads out from list (#8008)

This commit is contained in:
Germain 2022-03-10 09:14:21 +00:00 committed by GitHub
parent 93bde40568
commit 3d6dece344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,8 +91,8 @@ export async function getThreadTimelineSet(
});
Array.from(room.threads)
.sort(([, threadA], [, threadB]) => threadA.replyToEvent.getTs() - threadB.replyToEvent.getTs())
.forEach(([, thread]) => {
if (thread.length === 0) return;
const currentUserParticipated = thread.events.some(event => event.getSender() === client.getUserId());
if (filterType !== ThreadFilterType.My || currentUserParticipated) {
timelineSet.getLiveTimeline().addEvent(thread.rootEvent, false);