From 14b5ed01d3b951f2fa456c7bf980a78bfafdc877 Mon Sep 17 00:00:00 2001 From: Germain Date: Tue, 23 Nov 2021 08:50:14 +0000 Subject: [PATCH] Change thread panel filtering (#7169) --- src/components/structures/ThreadPanel.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index f43b6409cd..04c69827fb 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -73,15 +73,13 @@ const useFilteredThreadsTimelinePanel = ({ const buildThreadList = useCallback(function(timelineSet: EventTimelineSet) { timelineSet.resetLiveTimeline(""); Array.from(threads) - .map(([, thread]) => thread) - .forEach(thread => { - const ownEvent = thread.rootEvent.getSender() === userId; - if (filterOption !== ThreadFilterType.My || ownEvent) { + .forEach(([, thread]) => { + if (filterOption !== ThreadFilterType.My || thread.hasCurrentUserParticipated) { timelineSet.addLiveEvent(thread.rootEvent); } }); updateTimeline(); - }, [filterOption, threads, updateTimeline, userId]); + }, [filterOption, threads, updateTimeline]); useEffect(() => { buildThreadList(timelineSet); }, [timelineSet, buildThreadList]);