Fix docs & add MatrixClient check

Addresses PR feedback without breaking RoomSettings
This commit is contained in:
David Baker 2017-02-15 19:01:00 +00:00
parent a5a056292d
commit 8698d40d3c

View file

@ -38,7 +38,7 @@ function parseIntWithDefault(val, def) {
const BannedUser = React.createClass({ const BannedUser = React.createClass({
propTypes: { propTypes: {
member: React.PropTypes.string.isRequired, member: React.PropTypes.object.isRequired, // js-sdk RoomMember
}, },
_onUnbanClick: function() { _onUnbanClick: function() {
@ -147,7 +147,10 @@ module.exports = React.createClass({
componentWillUnmount: function() { componentWillUnmount: function() {
ScalarMessaging.stopListening(); ScalarMessaging.stopListening();
MatrixClientPeg.get().removeListener("RoomMember.membership", this._onRoomMemberMembership); const cli = MatrixClientPeg.get();
if (cli) {
cli.removeListener("RoomMember.membership", this._onRoomMemberMembership);
}
dis.dispatch({ dis.dispatch({
action: 'ui_opacity', action: 'ui_opacity',