Fix issue with thread panel not updating when it loads on first render (#8382)
This commit is contained in:
parent
495a69532d
commit
763edb7ab9
2 changed files with 9 additions and 10 deletions
|
@ -198,9 +198,10 @@ const ThreadPanel: React.FC<IProps> = ({
|
|||
useEffect(() => {
|
||||
const room = mxClient.getRoom(roomId);
|
||||
room.createThreadsTimelineSets().then(() => {
|
||||
setRoom(room);
|
||||
return room.fetchRoomThreads();
|
||||
}).then(() => {
|
||||
setFilterOption(ThreadFilterType.All);
|
||||
room.fetchRoomThreads();
|
||||
setRoom(room);
|
||||
});
|
||||
}, [mxClient, roomId]);
|
||||
|
||||
|
@ -286,8 +287,8 @@ const ThreadPanel: React.FC<IProps> = ({
|
|||
sensor={card.current}
|
||||
onMeasurement={setNarrow}
|
||||
/>
|
||||
{ timelineSet && (
|
||||
<TimelinePanel
|
||||
{ timelineSet
|
||||
? <TimelinePanel
|
||||
key={timelineSet.getFilter()?.filterId ?? (roomId + ":" + filterOption)}
|
||||
ref={timelinePanel}
|
||||
showReadReceipts={false} // No RR support in thread's MVP
|
||||
|
@ -311,7 +312,8 @@ const ThreadPanel: React.FC<IProps> = ({
|
|||
permalinkCreator={permalinkCreator}
|
||||
disableGrouping={true}
|
||||
/>
|
||||
) }
|
||||
: <div className="mx_AutoHideScrollbar" />
|
||||
}
|
||||
</BaseCard>
|
||||
</RoomContext.Provider>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue