Correctly handle Room.timeline events which have a nullable Room (#7635)

This commit is contained in:
Michael Telatynski 2022-01-26 13:24:14 +00:00 committed by GitHub
parent d239697384
commit 8e4ced6454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 62 additions and 55 deletions

View file

@ -91,8 +91,8 @@ export default class WhoIsTypingTile extends React.Component<IProps, IState> {
return WhoIsTypingTile.isVisible(this.state);
};
private onRoomTimeline = (event: MatrixEvent, room: Room): void => {
if (room?.roomId === this.props.room?.roomId) {
private onRoomTimeline = (event: MatrixEvent, room: Room | null): void => {
if (room?.roomId === this.props.room.roomId) {
const userId = event.getSender();
// remove user from usersTyping
const usersTyping = this.state.usersTyping.filter((m) => m.userId !== userId);