mirror of https://github.com/vector-im/riot-web
Merge pull request #4547 from matrix-org/travis/fix-user-panel
Don't try to reload profile information when closing the user panelpull/21833/head
commit
2aa7a6087c
|
@ -227,7 +227,7 @@ export default class RightPanel extends React.Component {
|
|||
if (this.props.user) {
|
||||
// If we have a user prop then we're displaying a user from the 'user' page type
|
||||
// in LoggedInView, so need to change the page type to close the panel (we switch
|
||||
// to the home page which is not obviosuly the correct thing to do, but I'm not sure
|
||||
// to the home page which is not obviously the correct thing to do, but I'm not sure
|
||||
// anything else is - we could hide the close button altogether?)
|
||||
dis.dispatch({
|
||||
action: "view_home_page",
|
||||
|
|
|
@ -42,7 +42,10 @@ export default class UserView extends React.Component {
|
|||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.userId !== this.props.userId) {
|
||||
// XXX: We shouldn't need to null check the userId here, but we declare
|
||||
// it as optional and MatrixChat sometimes fires in a way which results
|
||||
// in an NPE when we try to update the profile info.
|
||||
if (prevProps.userId !== this.props.userId && this.props.userId) {
|
||||
this._loadProfileInfo();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,10 @@ export default class SecurityUserSettingsTab extends React.Component {
|
|||
};
|
||||
|
||||
_onGoToUserProfileClick = () => {
|
||||
window.location.href = "#/user/" + MatrixClientPeg.get().getUserId();
|
||||
dis.dispatch({
|
||||
action: 'view_user_info',
|
||||
userId: MatrixClientPeg.get().getUserId(),
|
||||
});
|
||||
this.props.closeSettingsFn();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue