Merge pull request #5592 from matrix-org/jryans/opt-room-id

Tweak a few room ID checks
This commit is contained in:
J. Ryan Stinnett 2021-02-01 10:54:29 +00:00 committed by GitHub
commit 50452d52ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -45,7 +45,7 @@ class FilePanel extends React.Component {
}; };
onRoomTimeline = (ev, room, toStartOfTimeline, removed, data) => { onRoomTimeline = (ev, room, toStartOfTimeline, removed, data) => {
if (room.roomId !== this.props.roomId) return; if (room?.roomId !== this.props?.roomId) return;
if (toStartOfTimeline || !data || !data.liveEvent || ev.isRedacted()) return; if (toStartOfTimeline || !data || !data.liveEvent || ev.isRedacted()) return;
if (ev.isBeingDecrypted()) { if (ev.isBeingDecrypted()) {

View file

@ -81,7 +81,7 @@ export default class WhoIsTypingTile extends React.Component {
}; };
onRoomTimeline = (event, room) => { onRoomTimeline = (event, room) => {
if (room && room.roomId === this.props.room.roomId) { if (room?.roomId === this.props.room?.roomId) {
const userId = event.getSender(); const userId = event.getSender();
// remove user from usersTyping // remove user from usersTyping
const usersTyping = this.state.usersTyping.filter((m) => m.userId !== userId); const usersTyping = this.state.usersTyping.filter((m) => m.userId !== userId);