aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-01-18 13:09:54 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:54 +0300
commitff17f69e7bede0f176223566abc2047d3ea2e665 (patch)
tree12088039b51b43139772ddb7ee11877e9c1fe386 /vnext/src/components
parent7cedf64d60b3c7ae6a6c0b48debdb09665385b96 (diff)
Fix Avatar reload on url change
Diffstat (limited to 'vnext/src/components')
-rw-r--r--vnext/src/components/Avatar.js9
-rw-r--r--vnext/src/components/UserInfo.js2
2 files changed, 10 insertions, 1 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js
index a83107ce4..660847f2a 100644
--- a/vnext/src/components/Avatar.js
+++ b/vnext/src/components/Avatar.js
@@ -27,6 +27,15 @@ class Avatar extends React.Component {
});
}
}
+ shouldComponentUpdate(nextProps, nextState) {
+ return this.state.user.avatar != nextState.user.avatar || this.state.user.uid != nextState.user.uid
+ || this.props.user.avatar != nextProps.user.avatar || this.props.user.uid != nextProps.user.uid;
+ }
+ componentDidUpdate(prevProps, prevState, shouldReload) {
+ this.setState({
+ user: this.props.user
+ });
+ }
render() {
let user = this.state.user;
return (
diff --git a/vnext/src/components/UserInfo.js b/vnext/src/components/UserInfo.js
index 9f8e3ca05..c962add9a 100644
--- a/vnext/src/components/UserInfo.js
+++ b/vnext/src/components/UserInfo.js
@@ -75,7 +75,7 @@ export default class UserInfo extends React.Component {
</>
}
</div>
- { this.props.children }
+ {this.props.children}
</>
);
}