From a8016f1bfe278b697abbae2cfeb7af8c52abbb70 Mon Sep 17 00:00:00 2001 From: Eric <45801973+waresnew@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:01:42 -0400 Subject: [PATCH] don't add duplicate msgs --- src/plugins/findReply/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/findReply/index.tsx b/src/plugins/findReply/index.tsx index a0433e20a..ce964ccd1 100644 --- a/src/plugins/findReply/index.tsx +++ b/src/plugins/findReply/index.tsx @@ -43,21 +43,24 @@ let madeComponent = false; function findReplies(message: Message) { const messages: Array = [...MessageStore.getMessages(message.channel_id)?._array ?? []].filter(m => !m.deleted).sort((a, b) => a.timestamp.getTime()-b.timestamp.getTime()); // Need to deep copy Message array when sorting + }> = [...MessageStore.getMessages(message.channel_id)?._array ?? []].filter(m => !m.deleted).sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime()); // Need to deep copy Message array when sorting const found: Message[] = []; for (const other of messages) { if (new Date(other.timestamp.toString()).getTime() <= new Date(message.timestamp.toString()).getTime()) continue; if (other.messageReference?.message_id === message.id) { found.push(other); + continue; } if (Vencord.Settings.plugins.FindReply.includePings) { if (other.content?.includes(`<@${message.author.id}>`)) { found.push(other); + continue; } } if (Vencord.Settings.plugins.FindReply.includeAuthor) { if (messages.find(m => m.id === other.messageReference?.message_id)?.author.id === message.author.id) { found.push(other); + continue; } } }