]> Untitled Git - lemmy-ui.git/commitdiff
Add default profile picture for users who do not set one (#1339)
authorSleeplessOne1917 <abias1122@gmail.com>
Sat, 17 Jun 2023 12:00:13 +0000 (12:00 +0000)
committerGitHub <noreply@github.com>
Sat, 17 Jun 2023 12:00:13 +0000 (08:00 -0400)
src/shared/components/person/person-details.tsx
src/shared/components/person/person-listing.tsx

index 07f5431fff25c04ba9d0ca72ff8e99f5035495e8..d1f319606f260a1917a585b65af1acd44352af77 100644 (file)
@@ -107,16 +107,6 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
     setupTippy();
   }
 
-  // TODO wut?
-  // componentDidUpdate(lastProps: UserDetailsProps) {
-  //   for (const key of Object.keys(lastProps)) {
-  //     if (lastProps[key] !== this.props[key]) {
-  //       this.fetchUserData();
-  //       break;
-  //     }
-  //   }
-  // }
-
   render() {
     return (
       <div>
index 1f0466b485951b9f8d799b39b18a1ea165bebf20..fe8b8418628e2ca191a7d23ea9b415304cec8722 100644 (file)
@@ -73,10 +73,14 @@ export class PersonListing extends Component<PersonListingProps, any> {
     const avatar = this.props.person.avatar;
     return (
       <>
-        {avatar &&
-          !this.props.hideAvatar &&
+        {!this.props.hideAvatar &&
           !this.props.person.banned &&
-          showAvatars() && <PictrsImage src={avatar} icon />}
+          showAvatars() && (
+            <PictrsImage
+              src={avatar ?? "/static/assets/icons/icon-96x96.png"}
+              icon
+            />
+          )}
         <span>{displayName}</span>
       </>
     );