فهرست منبع

use imageUrlCached

yusuketk 5 سال پیش
والد
کامیت
e52eee6524
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      src/client/js/components/User/UserPicture.jsx

+ 8 - 1
src/client/js/components/User/UserPicture.jsx

@@ -63,11 +63,18 @@ export default class UserPicture extends React.Component {
       RootElm = this.withTooltip(RootElm);
     }
 
+    let userPictureSrc;
+    if (user.imageUrlCached != null) {
+      userPictureSrc = user.imageUrlCached;
+    }
+    else {
+      userPictureSrc = DEFAULT_IMAGE;
+    }
 
     return (
       <RootElm>
         <img
-          src={this.getUserPicture(user)}
+          src={userPictureSrc}
           alt={user.username}
           className={this.getClassName()}
         />