From d504afa9d1de6b9895099307f7bbf2a650dbd352 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 18 Nov 2019 06:25:47 +0900 Subject: [PATCH] Refactor --- src/remote/activitypub/models/person.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index c7a6d5663..80b237f87 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -201,14 +201,14 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise([ + const [avatar, banner] = await Promise.all([ person.icon, person.image ].map(img => img == null ? Promise.resolve(null) : resolveImage(user!, img).catch(() => null) - ))); + )); const avatarId = avatar ? avatar.id : null; const bannerId = banner ? banner.id : null; @@ -290,14 +290,14 @@ export async function updatePerson(uri: string, resolver?: Resolver | null, hint logger.info(`Updating the Person: ${person.id}`); // アバターとヘッダー画像をフェッチ - const [avatar, banner] = (await Promise.all([ + const [avatar, banner] = await Promise.all([ person.icon, person.image ].map(img => img == null ? Promise.resolve(null) : resolveImage(exist, img).catch(() => null) - ))); + )); // カスタム絵文字取得 const emojis = await extractEmojis(person.tag || [], exist.host).catch(e => {