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

Commit 5a183c5

Browse files
author
Germain Souquet
committed
Use null guarded thread getter in EventTile
1 parent f2d360e commit 5a183c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/views/rooms/EventTile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +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 room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
387-
const thread = room.threads?.get(this.props.mxEvent.getId());
386+
this.context = context;
387+
const thread = this.thread;
388388

389389
this.state = {
390390
// Whether the action bar is focused.
@@ -630,7 +630,7 @@ export default class EventTile extends React.Component<IProps, IState> {
630630
* We currently have no reliable way to discover than an event is a thread
631631
* when we are at the sync stage
632632
*/
633-
const room = this.context.getRoom(this.props.mxEvent.getRoomId());
633+
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
634634
const thread = room?.threads.get(this.props.mxEvent.getId());
635635

636636
if (!thread || thread.length === 0) {

0 commit comments

Comments
 (0)