Remove duplicate mentions when preparing reply

This commit is contained in:
silverpill 2022-02-16 17:13:07 +00:00
parent 685ca20bb2
commit 88bdd69233

View file

@ -150,6 +150,8 @@ export default class PostEditor extends Vue {
this.content = mentions
.filter(mention => mention.id !== this.store.currentUser?.id)
.map(mention => "@" + this.store.getActorAddress(mention))
// Remove duplicates
.filter((mention, index, mentions) => mentions.indexOf(mention) === index)
.join(" ")
}
if (this.inReplyTo && this.inReplyTo.visibility !== Visibility.Public) {