From 88bdd69233774e1a54a1e3b5cf186cee1c196832 Mon Sep 17 00:00:00 2001 From: silverpill Date: Wed, 16 Feb 2022 17:13:07 +0000 Subject: [PATCH] Remove duplicate mentions when preparing reply --- src/components/PostEditor.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/PostEditor.vue b/src/components/PostEditor.vue index ca3ed8a..77a82d5 100644 --- a/src/components/PostEditor.vue +++ b/src/components/PostEditor.vue @@ -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) {