You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-11 17:57:29 +03:00
Filter empty threads out from list (#8008)
This commit is contained in:
@@ -91,8 +91,8 @@ export async function getThreadTimelineSet(
|
|||||||
});
|
});
|
||||||
|
|
||||||
Array.from(room.threads)
|
Array.from(room.threads)
|
||||||
.sort(([, threadA], [, threadB]) => threadA.replyToEvent.getTs() - threadB.replyToEvent.getTs())
|
|
||||||
.forEach(([, thread]) => {
|
.forEach(([, thread]) => {
|
||||||
|
if (thread.length === 0) return;
|
||||||
const currentUserParticipated = thread.events.some(event => event.getSender() === client.getUserId());
|
const currentUserParticipated = thread.events.some(event => event.getSender() === client.getUserId());
|
||||||
if (filterType !== ThreadFilterType.My || currentUserParticipated) {
|
if (filterType !== ThreadFilterType.My || currentUserParticipated) {
|
||||||
timelineSet.getLiveTimeline().addEvent(thread.rootEvent, false);
|
timelineSet.getLiveTimeline().addEvent(thread.rootEvent, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user