Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 038f67e

Browse files
Germaint3chguy
andauthored
Improved threads stability (#7639)
Co-authored-by: Michael Telatynski <[email protected]>
1 parent e18bbb0 commit 038f67e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/components/structures/MessagePanel.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,11 @@ export default class MessagePanel extends React.Component<IProps, IState> {
485485

486486
// Checking if the message has a "parentEventId" as we do not
487487
// want to hide the root event of the thread
488-
if (mxEv.isThreadRelation && this.props.hideThreadedMessages
489-
&& SettingsStore.getValue("feature_thread")) {
488+
if (mxEv.isThreadRelation &&
489+
!mxEv.isThreadRoot &&
490+
this.props.hideThreadedMessages &&
491+
SettingsStore.getValue("feature_thread")
492+
) {
490493
return false;
491494
}
492495

src/components/structures/ThreadView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
139139
};
140140

141141
private setupThread = (mxEv: MatrixEvent) => {
142-
let thread = this.props.room.threads.get(mxEv.getId());
142+
let thread = this.props.room.threads?.get(mxEv.getId());
143143
if (!thread) {
144144
thread = this.props.room.createThread([mxEv]);
145145
}

src/components/views/rooms/EventTile.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ export default class EventTile extends React.Component<IProps, IState> {
383383
constructor(props: IProps, context: React.ContextType<typeof MatrixClientContext>) {
384384
super(props, context);
385385

386-
const thread = this.props.mxEvent?.getThread();
386+
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
387+
const thread = room.threads?.get(this.props.mxEvent.getId());
387388

388389
this.state = {
389390
// Whether the action bar is focused.

0 commit comments

Comments
 (0)