Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix a pair of warnings from RoomSettings
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
richvdh committed Jun 23, 2016
1 parent e741226 commit 7a7d7c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/views/elements/PowerSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ module.exports = React.createClass({

propTypes: {
value: React.PropTypes.number.isRequired,

// if true, the <select/> should be a 'controlled' form element and updated by React
// to reflect the current value, rather than left freeform.
// 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,
onChange: React.PropTypes.func,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = React.createClass({
tags_changed: false,
tags: tags,
areNotifsMuted: areNotifsMuted,
isRoomPublished: this._originalIsRoomPublished, // loaded async in componentWillMount
isRoomPublished: false, // loaded async in componentWillMount
};
},

Expand Down

0 comments on commit 7a7d7c0

Please sign in to comment.