From 41bc18f313d745c0dd91e1c00057aa01b94ae8c0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 4 Apr 2019 21:59:00 +0300 Subject: Fix avatar reload --- vnext/src/components/Avatar.js | 10 ++++++++-- vnext/src/components/Message.js | 2 +- vnext/src/components/UserInfo.js | 4 ++-- 3 files changed, 11 insertions(+), 5 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 (