1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-05 15:22:09 +03:00

Improve typing around event emitter handlers (#7816)

This commit is contained in:
Michael Telatynski
2022-02-22 12:18:08 +00:00
committed by GitHub
parent 213b32bf14
commit 7fa01ffb06
79 changed files with 548 additions and 471 deletions

View File

@@ -153,14 +153,12 @@ export default class ThreadView extends React.Component<IProps, IState> {
thread = this.props.room.createThread(mxEv);
}
thread.on(ThreadEvent.Update, this.updateLastThreadReply);
thread.once(ThreadEvent.Ready, this.updateThread);
this.updateThread(thread);
};
private teardownThread = () => {
if (this.state.thread) {
this.state.thread.removeListener(ThreadEvent.Update, this.updateLastThreadReply);
this.state.thread.removeListener(ThreadEvent.Ready, this.updateThread);
}
};