Improve addEventsToTimeline performance scoping WhoIsTypingTile::setState

pull/21833/head
Germain Souquet 2021-05-25 12:45:19 +01:00
parent 1751b4ba43
commit 88af74e4a4
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,9 @@ export default class WhoIsTypingTile extends React.Component {
const userId = event.getSender();
// remove user from usersTyping
const usersTyping = this.state.usersTyping.filter((m) => m.userId !== userId);
if (usersTyping.length !== this.state.usersTyping.length) {
this.setState({usersTyping});
}
// abort timer if any
this._abortUserTimer(userId);
}