diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 7837702473..e5c7989518 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -628,11 +628,7 @@ export default class EventTile extends React.Component { const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId()); const thread = room?.threads.get(this.props.mxEvent.getId()); - if (!thread || thread.length === 0) { - return null; - } - - return thread; + return thread || null; } private renderThreadPanelSummary(): JSX.Element | null { @@ -676,7 +672,7 @@ export default class EventTile extends React.Component { return (

{ _t("From a thread") }

); - } else if (this.state.threadReplyCount && this.props.mxEvent.isThreadRoot) { + } else if (this.state.threadReplyCount && this.state.thread.id === this.props.mxEvent.getId()) { let count: string | number = this.state.threadReplyCount; if (!this.context.narrow) { count = _t("%(count)s reply", { @@ -1303,13 +1299,10 @@ export default class EventTile extends React.Component { || this.state.hover || this.state.actionBarFocused); - const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId()); - const thread = room?.findThreadForEvent?.(this.props.mxEvent); - // Thread panel shows the timestamp of the last reply in that thread const ts = this.context.timelineRenderingType !== TimelineRenderingType.ThreadsList ? this.props.mxEvent.getTs() - : thread?.replyToEvent.getTs(); + : this.state.thread?.replyToEvent.getTs(); const messageTimestamp =