Don't try to reload profile information when closing the user panel

Fixes https://github.com/vector-im/riot-web/issues/13479

This looks to have been caused by something to do with the app load order, though where is a mystery. The view change seems to fire for the same page type despite a dispatch that says to change the view type.

Instead of debugging it too much further, we'll just patch around it.

This commit also makes the settings link use a more safe approach to viewing the user info - not going through the dispatcher means we are at the mercy of browser behaviour when we already have a loop which deals with this.
This commit is contained in:
Travis Ralston 2020-05-04 15:41:26 -06:00
parent 5ac5c056e3
commit 9a14417a03
3 changed files with 9 additions and 3 deletions

View file

@ -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();
}
}