This repository was archived by the owner on Oct 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const UserSchema = new Schema({
77 password : String ,
88 followers : Array ,
99 following : Array ,
10- profileImageKey : String ,
10+ profileImageKey : { type : String , default : '' } ,
1111 publicId : String ,
1212 hideFollowing : { type : Boolean , default : false } ,
1313 hideFollowers : { type : Boolean , default : false }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const HistoryViewer = () => {
3939 const { profileData, editHistory, currentPost} = result ;
4040
4141 if ( currentPost . imageKey ) currentPost . image = ( 'data:image/jpeg;base64,' + ( await axios . get ( `${ serverUrl } /image/${ currentPost . imageKey } ` ) ) . data )
42- profileData . profilePicture = profileData . profileImageKey !== '' ? ( 'data:image/jpeg;base64,' + ( await axios . get ( `${ serverUrl } /image/${ profileData . profileImageKey } ` ) ) . data ) : defaultPfp
42+ profileData . profilePicture = profileData ?. profileImageKey && profileData ? .profileImageKey !== '' ? ( 'data:image/jpeg;base64,' + ( await axios . get ( `${ serverUrl } /image/${ profileData . profileImageKey } ` ) ) . data ) : defaultPfp
4343 setCurrentPost ( currentPost )
4444 setEditHistory ( editHistory . sort ( ( a , b ) => b . dateMade - a . dateMade ) )
4545 setProfileData ( profileData )
You can’t perform that action at this time.
0 commit comments