Use null guarded thread getter in EventTile
This commit is contained in:
parent
f2d360e639
commit
5a183c590e
1 changed files with 3 additions and 3 deletions
|
@ -383,8 +383,8 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
constructor(props: IProps, context: React.ContextType<typeof MatrixClientContext>) {
|
constructor(props: IProps, context: React.ContextType<typeof MatrixClientContext>) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
this.context = context;
|
||||||
const thread = room.threads?.get(this.props.mxEvent.getId());
|
const thread = this.thread;
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
// Whether the action bar is focused.
|
// Whether the action bar is focused.
|
||||||
|
@ -630,7 +630,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
* We currently have no reliable way to discover than an event is a thread
|
* We currently have no reliable way to discover than an event is a thread
|
||||||
* when we are at the sync stage
|
* when we are at the sync stage
|
||||||
*/
|
*/
|
||||||
const room = this.context.getRoom(this.props.mxEvent.getRoomId());
|
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
||||||
const thread = room?.threads.get(this.props.mxEvent.getId());
|
const thread = room?.threads.get(this.props.mxEvent.getId());
|
||||||
|
|
||||||
if (!thread || thread.length === 0) {
|
if (!thread || thread.length === 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue