Change thread panel filtering (#7169)

This commit is contained in:
Germain 2021-11-23 08:50:14 +00:00 committed by GitHub
parent df032b04e0
commit 14b5ed01d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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