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 committed by Sam Therapy
parent 03a4cd3704
commit 843cd16242
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD

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