File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ module.exports = React.createClass({
5959 </ div >
6060 < div className = "mx_RoomHeader_info" >
6161 < div className = "mx_RoomHeader_name" >
62- < EditableText initalValue = { this . props . room . name } onValueChanged = { this . onNameChange } />
62+ < EditableText initialValue = { this . props . room . name } onValueChanged = { this . onNameChange } />
6363 </ div >
6464 { topic }
6565 </ div >
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ module.exports = React.createClass({
6464 </ div >
6565
6666 < div className = "mx_UserSettings_DisplayName" >
67- < EditableText ref = "displayname" initalValue = { this . state . displayName } placeHolder = "Click to set display name." onValueChanged = { this . changeDisplayname } />
67+ < EditableText ref = "displayname" initialValue = { this . state . displayName } placeHolder = "Click to set display name." onValueChanged = { this . changeDisplayname } />
6868 < div className = "mx_UserSettings_DisplayName_Edit" onClick = { this . editDisplayName } > Edit</ div >
6969 </ div >
7070
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ var React = require('react');
2121module . exports = {
2222 propTypes : {
2323 onValueChanged : React . PropTypes . func ,
24- initalValue : React . PropTypes . string ,
24+ initialValue : React . PropTypes . string ,
2525 placeHolder : React . PropTypes . string ,
2626 } ,
2727
@@ -33,18 +33,24 @@ module.exports = {
3333 getDefaultProps : function ( ) {
3434 return {
3535 onValueChanged : function ( ) { } ,
36- initalValue : '' ,
36+ initialValue : '' ,
3737 placeHolder : 'Click to set' ,
3838 } ;
3939 } ,
4040
4141 getInitialState : function ( ) {
4242 return {
43- value : this . props . initalValue ,
43+ value : this . props . initialValue ,
4444 phase : this . Phases . Display ,
4545 }
4646 } ,
4747
48+ componentWillReceiveProps : function ( nextProps ) {
49+ this . setState ( {
50+ value : nextProps . initialValue
51+ } ) ;
52+ } ,
53+
4854 getValue : function ( ) {
4955 return this . state . value ;
5056 } ,
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ module.exports = {
4949 componentWillMount : function ( ) {
5050 this . dispatcherRef = dis . register ( this . onAction ) ;
5151 MatrixClientPeg . get ( ) . on ( "Room.timeline" , this . onRoomTimeline ) ;
52+ MatrixClientPeg . get ( ) . on ( "Room.name" , this . onRoomName ) ;
5253 this . atBottom = true ;
5354 } ,
5455
@@ -60,6 +61,7 @@ module.exports = {
6061 dis . unregister ( this . dispatcherRef ) ;
6162 if ( MatrixClientPeg . get ( ) ) {
6263 MatrixClientPeg . get ( ) . removeListener ( "Room.timeline" , this . onRoomTimeline ) ;
64+ MatrixClientPeg . get ( ) . removeListener ( "Room.name" , this . onRoomName ) ;
6365 }
6466 } ,
6567
@@ -106,6 +108,14 @@ module.exports = {
106108 }
107109 } ,
108110
111+ onRoomName : function ( room ) {
112+ if ( room . roomId == this . props . roomId ) {
113+ this . setState ( {
114+ room : room
115+ } ) ;
116+ }
117+ } ,
118+
109119 componentDidMount : function ( ) {
110120 if ( this . refs . messageWrapper ) {
111121 var messageWrapper = this . refs . messageWrapper . getDOMNode ( ) ;
You can’t perform that action at this time.
0 commit comments