mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Listen for Room and use this to init the timeline, not Room.name
This commit is contained in:
parent
c9a3ad31ab
commit
3c2c2b051b
@ -122,6 +122,7 @@ module.exports = React.createClass({
|
||||
componentWillMount: function() {
|
||||
this.last_rr_sent_event_id = undefined;
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
MatrixClientPeg.get().on("Room", this.onRoom);
|
||||
MatrixClientPeg.get().on("Room.timeline", this.onRoomTimeline);
|
||||
MatrixClientPeg.get().on("Room.name", this.onRoomName);
|
||||
MatrixClientPeg.get().on("Room.accountData", this.onRoomAccountData);
|
||||
@ -418,12 +419,20 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
onRoom: function(room) {
|
||||
if (room.roomId == this.props.roomId) {
|
||||
this.setState({
|
||||
room: room
|
||||
});
|
||||
this._initTimeline(this.props).done();
|
||||
}
|
||||
},
|
||||
|
||||
onRoomName: function(room) {
|
||||
if (room.roomId == this.props.roomId) {
|
||||
this.setState({
|
||||
room: room
|
||||
});
|
||||
this._initTimeline(this.props);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user