Update room header when room name changes
This commit is contained in:
parent
8fe6411539
commit
6a76d8ace8
4 changed files with 21 additions and 5 deletions
|
@ -49,6 +49,7 @@ module.exports = {
|
|||
componentWillMount: function() {
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
MatrixClientPeg.get().on("Room.timeline", this.onRoomTimeline);
|
||||
MatrixClientPeg.get().on("Room.name", this.onRoomName);
|
||||
this.atBottom = true;
|
||||
},
|
||||
|
||||
|
@ -60,6 +61,7 @@ module.exports = {
|
|||
dis.unregister(this.dispatcherRef);
|
||||
if (MatrixClientPeg.get()) {
|
||||
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
||||
MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -106,6 +108,14 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
|
||||
onRoomName: function(room) {
|
||||
if (room.roomId == this.props.roomId) {
|
||||
this.setState({
|
||||
room: room
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
if (this.refs.messageWrapper) {
|
||||
var messageWrapper = this.refs.messageWrapper.getDOMNode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue