Fix a pair of warnings from RoomSettings

- initialise the 'publish' checkbox correctly so react doesn't grumble about it
  turning from uncontrolled into controlled

- PowerSelector's 'controlled' property isn't really required, so mark it as
  such.
This commit is contained in:
Richard van der Hoff 2016-06-23 11:15:55 +01:00
parent e741226c02
commit 7a7d7c0e02
2 changed files with 7 additions and 2 deletions

View file

@ -34,10 +34,15 @@ module.exports = React.createClass({
propTypes: { propTypes: {
value: React.PropTypes.number.isRequired, value: React.PropTypes.number.isRequired,
// if true, the <select/> should be a 'controlled' form element and updated by React // if true, the <select/> should be a 'controlled' form element and updated by React
// to reflect the current value, rather than left freeform. // to reflect the current value, rather than left freeform.
// MemberInfo uses controlled; RoomSettings uses non-controlled. // MemberInfo uses controlled; RoomSettings uses non-controlled.
controlled: React.PropTypes.bool.isRequired, //
// ignored if disabled is truthy. false by default.
controlled: React.PropTypes.bool,
// should the user be able to change the value? false by default.
disabled: React.PropTypes.bool, disabled: React.PropTypes.bool,
onChange: React.PropTypes.func, onChange: React.PropTypes.func,
}, },

View file

@ -64,7 +64,7 @@ module.exports = React.createClass({
tags_changed: false, tags_changed: false,
tags: tags, tags: tags,
areNotifsMuted: areNotifsMuted, areNotifsMuted: areNotifsMuted,
isRoomPublished: this._originalIsRoomPublished, // loaded async in componentWillMount isRoomPublished: false, // loaded async in componentWillMount
}; };
}, },