From 008432e156ef540245f81c2326efd311840a67d0 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 6 Dec 2018 19:15:09 +0900 Subject: [PATCH] lint fix (#3522) --- src/remote/activitypub/renderer/person.ts | 41 ++++++++++++++--------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts index 4a6a54881..2c411e544 100644 --- a/src/remote/activitypub/renderer/person.ts +++ b/src/remote/activitypub/renderer/person.ts @@ -15,28 +15,37 @@ export default async (user: ILocalUser) => { DriveFile.findOne({ _id: user.avatarId }), DriveFile.findOne({ _id: user.bannerId }) ]); - + const attachment: { type: string, name: string, value: string, verified_at?: string }[] = []; - user.twitter && attachment.push({ - type: 'PropertyValue', - name: 'Twitter', - value: `@${user.twitter.screenName}` - }); - user.github && attachment.push({ - type: 'PropertyValue', - name: 'GitHub', - value: `@${user.github.login}` - }); - user.discord && attachment.push({ - type: 'PropertyValue', - name: 'Discord', - value: `@${user.discord.username}#${user.discord.discriminator}` - }); + + if (user.twitter) { + attachment.push({ + type: 'PropertyValue', + name: 'Twitter', + value: `@${user.twitter.screenName}` + }); + } + + if (user.github) { + attachment.push({ + type: 'PropertyValue', + name: 'GitHub', + value: `@${user.github.login}` + }); + } + + if (user.discord) { + attachment.push({ + type: 'PropertyValue', + name: 'Discord', + value: `@${user.discord.username}#${user.discord.discriminator}` + }); + } const emojis = await getEmojis(user.emojis); const apemojis = emojis.map(emoji => renderEmoji(emoji));