diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 9e97d64a77..66757fe0d6 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -485,8 +485,11 @@ export default class MessagePanel extends React.Component { // Checking if the message has a "parentEventId" as we do not // want to hide the root event of the thread - if (mxEv.isThreadRelation && this.props.hideThreadedMessages - && SettingsStore.getValue("feature_thread")) { + if (mxEv.isThreadRelation && + !mxEv.isThreadRoot && + this.props.hideThreadedMessages && + SettingsStore.getValue("feature_thread") + ) { return false; } diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index f472946aee..fc478b9988 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -139,7 +139,7 @@ export default class ThreadView extends React.Component { }; private setupThread = (mxEv: MatrixEvent) => { - let thread = this.props.room.threads.get(mxEv.getId()); + let thread = this.props.room.threads?.get(mxEv.getId()); if (!thread) { thread = this.props.room.createThread([mxEv]); } diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index e0a907f488..615a0d9eae 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -383,7 +383,8 @@ export default class EventTile extends React.Component { constructor(props: IProps, context: React.ContextType) { super(props, context); - const thread = this.props.mxEvent?.getThread(); + const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId()); + const thread = room.threads?.get(this.props.mxEvent.getId()); this.state = { // Whether the action bar is focused.