mirror of https://github.com/vector-im/riot-web
Wait for first sync before dispatching view_user on /user
the RightPanel will be mounted once we're done doing the first sync, so wait until then and then dispatch a view_user. This is not very nice but it's what we do for view_room.pull/21833/head
parent
d9e8292a5e
commit
b59de7964c
|
@ -301,13 +301,13 @@ export default React.createClass({
|
||||||
|
|
||||||
case PageTypes.UserView:
|
case PageTypes.UserView:
|
||||||
page_element = null; // deliberately null for now
|
page_element = null; // deliberately null for now
|
||||||
right_panel = <RightPanel userId={this.props.viewUserId} opacity={this.props.rightOpacity} />;
|
right_panel = <RightPanel opacity={this.props.rightOpacity} />;
|
||||||
break;
|
break;
|
||||||
case PageTypes.GroupView:
|
case PageTypes.GroupView:
|
||||||
page_element = <GroupView
|
page_element = <GroupView
|
||||||
groupId={this.props.currentGroupId}
|
groupId={this.props.currentGroupId}
|
||||||
/>;
|
/>;
|
||||||
//right_panel = <RightPanel userId={this.props.viewUserId} opacity={this.props.rightOpacity} />;
|
//right_panel = <RightPanel opacity={this.props.rightOpacity} />;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1203,21 +1203,22 @@ module.exports = React.createClass({
|
||||||
} else if (screen.indexOf('user/') == 0) {
|
} else if (screen.indexOf('user/') == 0) {
|
||||||
const userId = screen.substring(5);
|
const userId = screen.substring(5);
|
||||||
|
|
||||||
if (params.action === 'chat') {
|
const waitFor = this.firstSyncPromise ?
|
||||||
this._chatCreateOrReuse(userId);
|
this.firstSyncPromise.promise : Promise.resolve();
|
||||||
return;
|
waitFor.then(() => {
|
||||||
}
|
if (params.action === 'chat') {
|
||||||
|
this._chatCreateOrReuse(userId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({ viewUserId: userId });
|
this._setPage(PageTypes.UserView);
|
||||||
this._setPage(PageTypes.UserView);
|
this.notifyNewScreen('user/' + userId);
|
||||||
this.notifyNewScreen('user/' + userId);
|
const member = new Matrix.RoomMember(null, userId);
|
||||||
const member = new Matrix.RoomMember(null, userId);
|
|
||||||
if (member) {
|
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_user',
|
action: 'view_user',
|
||||||
member: member,
|
member: member,
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
} else if (screen.indexOf('group/') == 0) {
|
} else if (screen.indexOf('group/') == 0) {
|
||||||
const groupId = screen.substring(6);
|
const groupId = screen.substring(6);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue