Change thread panel filtering (#7169)
This commit is contained in:
parent
df032b04e0
commit
14b5ed01d3
1 changed files with 3 additions and 5 deletions
|
@ -73,15 +73,13 @@ const useFilteredThreadsTimelinePanel = ({
|
||||||
const buildThreadList = useCallback(function(timelineSet: EventTimelineSet) {
|
const buildThreadList = useCallback(function(timelineSet: EventTimelineSet) {
|
||||||
timelineSet.resetLiveTimeline("");
|
timelineSet.resetLiveTimeline("");
|
||||||
Array.from(threads)
|
Array.from(threads)
|
||||||
.map(([, thread]) => thread)
|
.forEach(([, thread]) => {
|
||||||
.forEach(thread => {
|
if (filterOption !== ThreadFilterType.My || thread.hasCurrentUserParticipated) {
|
||||||
const ownEvent = thread.rootEvent.getSender() === userId;
|
|
||||||
if (filterOption !== ThreadFilterType.My || ownEvent) {
|
|
||||||
timelineSet.addLiveEvent(thread.rootEvent);
|
timelineSet.addLiveEvent(thread.rootEvent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateTimeline();
|
updateTimeline();
|
||||||
}, [filterOption, threads, updateTimeline, userId]);
|
}, [filterOption, threads, updateTimeline]);
|
||||||
|
|
||||||
useEffect(() => { buildThreadList(timelineSet); }, [timelineSet, buildThreadList]);
|
useEffect(() => { buildThreadList(timelineSet); }, [timelineSet, buildThreadList]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue