Explain roomId workaround
parent
9d3ba2b3d9
commit
44e34d9074
|
@ -283,6 +283,15 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getRoomId() {
|
||||||
|
// According to `_onRoomViewStoreUpdate`, `state.roomId` can be null
|
||||||
|
// if we have a room alias we haven't resolved yet. To work around this,
|
||||||
|
// first we'll try the room object if it's there, and then fallback to
|
||||||
|
// the bare room ID. (We may want to update `state.roomId` after
|
||||||
|
// resolving aliases, so we could always trust it.)
|
||||||
|
return this.state.room ? this.state.room.roomId : this.state.roomId;
|
||||||
|
},
|
||||||
|
|
||||||
_onWidgetEchoStoreUpdate: function() {
|
_onWidgetEchoStoreUpdate: function() {
|
||||||
this.setState({
|
this.setState({
|
||||||
showApps: this._shouldShowApps(this.state.room),
|
showApps: this._shouldShowApps(this.state.room),
|
||||||
|
@ -882,7 +891,7 @@ module.exports = React.createClass({
|
||||||
action: 'do_after_sync_prepared',
|
action: 'do_after_sync_prepared',
|
||||||
deferred_action: {
|
deferred_action: {
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
room_id: this.state.room ? this.state.room.roomId : this.state.roomId,
|
room_id: this._getRoomId(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue