From 2182af405864cffcc7ddca8d373cc14f38770c9e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 12 Aug 2021 03:08:57 +0300 Subject: [PATCH] made the code responsible for showing unwritten mentions actually work --- src/components/status/status.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 8aa73a22..54f304a2 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -176,15 +176,18 @@ const Status = { userId: attn.id })) }, - alsoMentions () { - if (!this.headTailLinks) return [] - const set = new Set(this.headTailLinks.writtenMentions.map(m => m.url)) - return this.headTailLinks.writtenMentions.filter(mention => { - return !set.has(mention.url) - }) - }, mentionsLine () { - return this.alsoMentions + const writtenMentions = this.headTailLinks ? this.headTailLinks.writtenMentions : [] + const set = new Set(writtenMentions.map(_ => _.url)) + return this.status.attentions.filter(attn => { + return attn.screen_name !== this.replyToName && + attn.screen_name !== this.status.user.screen_name && + !set.has(attn.url) + }).map(attn => ({ + url: attn.statusnet_profile_url, + content: attn.screen_name, + userId: attn.id + })) }, hasMentionsLine () { return this.mentionsLine.length > 0