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

pull/21833/head
Zoe 2020-01-13 11:18:24 +00:00
parent 54c69b4630
commit 422d4cd73a
1 changed files with 1 additions and 2 deletions

View File

@ -112,8 +112,7 @@ module.exports = createReactClass({
onJoinRule: function(ev) {
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 });
this.setState({ joinRule: ev.getContent().join_rule });
},
onAccountData: function(accountDataEvent) {