Merge pull request #6957 from matrix-org/gsouquet/fix-appearance-settings

pull/21833/head
Germain 2021-10-15 15:45:05 +01:00 committed by GitHub
commit 495f824f0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -478,7 +478,7 @@ export default class EventTile extends React.Component<IProps, IState> {
} }
const room = this.context.getRoom(this.props.mxEvent.getRoomId()); const room = this.context.getRoom(this.props.mxEvent.getRoomId());
room.on(ThreadEvent.New, this.onNewThread); room?.on(ThreadEvent.New, this.onNewThread);
} }
private updateThread = (thread) => { private updateThread = (thread) => {
@ -522,7 +522,7 @@ export default class EventTile extends React.Component<IProps, IState> {
} }
const room = this.context.getRoom(this.props.mxEvent.getRoomId()); const room = this.context.getRoom(this.props.mxEvent.getRoomId());
room.off(ThreadEvent.New, this.onNewThread); room?.off(ThreadEvent.New, this.onNewThread);
} }
componentDidUpdate(prevProps, prevState, snapshot) { componentDidUpdate(prevProps, prevState, snapshot) {
@ -553,7 +553,7 @@ export default class EventTile extends React.Component<IProps, IState> {
* when we are at the sync stage * when we are at the sync stage
*/ */
const room = MatrixClientPeg.get().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.ready) { if (thread && !thread.ready) {
thread.addEvent(this.props.mxEvent, true); thread.addEvent(this.props.mxEvent, true);