From 54c69b4630afd0d1819fbcd6e617c2e08b901832 Mon Sep 17 00:00:00 2001 From: Zoe Date: Fri, 10 Jan 2020 17:46:14 +0000 Subject: [PATCH] this is what we call fast iteration --- src/components/views/rooms/RoomTile.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index cc77bf5b3d..232e11cfd8 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -110,13 +110,9 @@ module.exports = createReactClass({ }, onJoinRule: function(ev) { - if (!ev || !ev.event ) return; - /* eslint-disable camelcase */ - const { event: { type, room_id } } = ev; - if (type !== "m.room.join_rules") return; - if (room_id !== this.props.room.roomId) return; - /* eslint-enable camelcase */ - const joinRule = event.getContent().join_rule; + if (ev.getType() !== "m.room.join_rules") return; + if (ev.getRoomId() !== this.props.room.roomId) return; + const joinRule = (ev.getContent() || {}).join_rule; this.setState({ joinRule }); },