File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ module.exports = React.createClass({
2828 mixins : [ RoomHeaderController ] ,
2929
3030 onNameChange : function ( new_name ) {
31- if ( this . props . room . name != new_name ) {
31+ if ( this . props . room . name != new_name && new_name ) {
3232 MatrixClientPeg . get ( ) . setRoomName ( this . props . room . roomId , new_name ) ;
3333 }
3434 } ,
@@ -69,16 +69,18 @@ module.exports = React.createClass({
6969 var topic_el = null ;
7070 var save_button = null ;
7171 var settings_button = null ;
72+ var actual_name = this . props . room . currentState . getStateEvents ( 'm.room.name' , '' ) ;
73+ if ( actual_name ) actual_name = actual_name . getContent ( ) . name ;
7274 if ( this . props . editing ) {
73- name = < input type = "text" defaultValue = { this . props . room . name } ref = "name_edit" /> ;
75+ name = < input type = "text" defaultValue = { actual_name } placeHolder = "Name" ref = "name_edit" /> ;
7476 // if (topic) topic_el = <div className="mx_RoomHeader_topic"><textarea>{ topic.getContent().topic }</textarea></div>
7577 save_button = (
7678 < div className = "mx_RoomHeader_button" onClick = { this . props . onSaveClick } >
7779 Save
7880 </ div >
7981 ) ;
8082 } else {
81- name = < EditableText initialValue = { this . props . room . name } onValueChanged = { this . onNameChange } /> ;
83+ name = < EditableText label = { this . props . room . name } initialValue = { actual_name } placeHolder = "Name" onValueChanged = { this . onNameChange } /> ;
8284 if ( topic ) topic_el = < div className = "mx_RoomHeader_topic" > { topic . getContent ( ) . topic } </ div > ;
8385 settings_button = (
8486 < div className = "mx_RoomHeader_button" onClick = { this . props . onSettingsClick } >
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ module.exports = React.createClass({
8383
8484 var deferreds = [ ] ;
8585
86- if ( old_name != new_name && new_name != undefined ) {
86+ if ( old_name != new_name && new_name != undefined && new_name ) {
8787 deferreds . push (
8888 MatrixClientPeg . get ( ) . setRoomName ( this . state . room . roomId , new_name )
8989 ) ;
You can’t perform that action at this time.
0 commit comments