You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Explain roomId workaround
This commit is contained in:
@@ -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(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user