small simplification in code as .getContent() will always return an object

This commit is contained in:
Zoe 2020-01-13 11:18:24 +00:00
parent 54c69b4630
commit 422d4cd73a

View file

@ -112,8 +112,7 @@ module.exports = createReactClass({
onJoinRule: function(ev) { onJoinRule: function(ev) {
if (ev.getType() !== "m.room.join_rules") return; if (ev.getType() !== "m.room.join_rules") return;
if (ev.getRoomId() !== this.props.room.roomId) return; if (ev.getRoomId() !== this.props.room.roomId) return;
const joinRule = (ev.getContent() || {}).join_rule; this.setState({ joinRule: ev.getContent().join_rule });
this.setState({ joinRule });
}, },
onAccountData: function(accountDataEvent) { onAccountData: function(accountDataEvent) {