Fix stale images (#618)

Co-authored-by: ekzyis <ek@stacker.news>
This commit is contained in:
ekzyis 2023-11-09 01:17:51 +01:00 committed by GitHub
parent 522c821c89
commit 41a1c686dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -71,15 +71,10 @@ function HeaderPhoto ({ user, isMe }) {
}
}
})
},
onCompleted ({ setPhoto: photoId }) {
const src = `https://${process.env.NEXT_PUBLIC_MEDIA_DOMAIN}/${user.photoId}`
setSrc(src)
}
}
)
const initialSrc = user.photoId ? `https://${process.env.NEXT_PUBLIC_MEDIA_DOMAIN}/${user.photoId}` : '/dorian400.jpg'
const [src, setSrc] = useState(initialSrc)
const src = user.photoId ? `https://${process.env.NEXT_PUBLIC_MEDIA_DOMAIN}/${user.photoId}` : '/dorian400.jpg'
return (
<div className='position-relative align-self-start' style={{ width: 'fit-content' }}>