1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-10 05:42:29 +03:00

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

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);