aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Avatar.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-04-04 21:59:00 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:54 +0300
commit41bc18f313d745c0dd91e1c00057aa01b94ae8c0 (patch)
treea47c327072915344d884b2fdd5d4ed21ef1e5bd8 /vnext/src/components/Avatar.js
parentaf69b9741e56141b6e17787a1b5373291016bd05 (diff)
Fix avatar reload
Diffstat (limited to 'vnext/src/components/Avatar.js')
-rw-r--r--vnext/src/components/Avatar.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js
index d4e83b7b..fed68ed1 100644
--- a/vnext/src/components/Avatar.js
+++ b/vnext/src/components/Avatar.js
@@ -17,11 +17,17 @@ function Avatar(props) {
useEffect(() => {
setUser(props.user);
isMounted = true;
-
+ if (!user.uid && !user.uname, user.uri) {
+ fetchUserUri(user.uri).then(response => {
+ if (isMounted) {
+ setUser(response.data);
+ }
+ });
+ }
return () => {
isMounted = false;
};
- }, [props.user, user.uid, user.uri]);
+ }, [props.user]);
return (
<div className="Avatar" style={props.style}>
<div className="msg-avatar">