From 681f78ee9868b34ccbb40a028a530d9ff17eacd7 Mon Sep 17 00:00:00 2001 From: split Date: Fri, 22 Nov 2024 22:43:46 -0800 Subject: [PATCH] fix(gravatar): :bug: not getting actual props --- src/translators/gravatar.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/translators/gravatar.ts b/src/translators/gravatar.ts index 05d4866..c68209d 100644 --- a/src/translators/gravatar.ts +++ b/src/translators/gravatar.ts @@ -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