made the code responsible for showing unwritten mentions actually work

This commit is contained in:
Henry Jameson 2021-08-12 03:08:57 +03:00
parent 2cfff1b8b9
commit 2182af4058

View File

@ -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