aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-04-04 21:46:29 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:54 +0300
commitaf69b9741e56141b6e17787a1b5373291016bd05 (patch)
treed05bceb59ea67b161879da2d1d1c7845992c8ec4 /vnext/src/components
parent41df2af75da0d4c1d76dffc98fdc55b31cc39776 (diff)
Fix external avatars
Diffstat (limited to 'vnext/src/components')
-rw-r--r--vnext/src/components/Avatar.js14
-rw-r--r--vnext/src/components/UserInfo.js8
2 files changed, 8 insertions, 14 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js
index dc2050ce..d4e83b7b 100644
--- a/vnext/src/components/Avatar.js
+++ b/vnext/src/components/Avatar.js
@@ -17,16 +17,10 @@ function Avatar(props) {
useEffect(() => {
setUser(props.user);
isMounted = true;
- if (!user.uid && user.uri) {
- fetchUserUri(user.uri).then(response => {
- if (isMounted) {
- setUser(response.data);
- }
- });
- return () => {
- isMounted = false;
- };
- }
+
+ return () => {
+ isMounted = false;
+ };
}, [props.user, user.uid, user.uri]);
return (
<div className="Avatar" style={props.style}>
diff --git a/vnext/src/components/UserInfo.js b/vnext/src/components/UserInfo.js
index 19b2f82b..835bbace 100644
--- a/vnext/src/components/UserInfo.js
+++ b/vnext/src/components/UserInfo.js
@@ -77,15 +77,15 @@ export function UserLink(props) {
setUser(response.data);
}
});
- return () => {
- isMounted = false;
- };
}
+ return () => {
+ isMounted = false;
+ };
}, [props.user, user.uid, user.uri]);
return (
user.uid ?
<Link key={user.uid} to={`/${user.uname}/`} className="info-avatar"><img src={user.avatar}/>{user.uname}</Link>
- : <a href={user.uri}><img src={user.avatar}/>{user.uname}</a>
+ : <a href={user.uri} className="info-avatar"><img src={user.avatar}/>{user.uname}</a>
);
}