fix(gravatar): 🐛 not getting actual props

This commit is contained in:
May 2024-11-22 22:43:46 -08:00
parent 7b7364fcb9
commit 681f78ee98
Signed by: split
GPG key ID: C325C61F0BF517C0

View file

@ -72,15 +72,19 @@ export default translator({
`gravatar: upload failed with ${uploadResult.status}`
)
const uprRes: { email_hash: string; image_id: string } =
await uploadResult.json(),
{ image_id } = uprRes,
const uprRes: {
user: { email_hash: string }
image: { image_id: string }
} = await uploadResult.json(),
{
image: { image_id },
} = uprRes,
email_hash = email
? crypto
.createHash("md5")
.update(email.toLowerCase())
.digest("hex")
: uprRes.email_hash
: uprRes.user.email_hash
// set its alt text