From 7c65c728b1067c3caeb1f1db4710cc49cffe9ddd Mon Sep 17 00:00:00 2001 From: newwares <45801973+waresnew@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:38:42 -0400 Subject: [PATCH] fix timestamp --- src/plugins/findReply/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/findReply/index.tsx b/src/plugins/findReply/index.tsx index 83a845af7..a0433e20a 100644 --- a/src/plugins/findReply/index.tsx +++ b/src/plugins/findReply/index.tsx @@ -43,12 +43,10 @@ let madeComponent = false; function findReplies(message: Message) { const messages: Array = [...MessageStore.getMessages(message.channel_id)?._array ?? []].filter(m => !m.deleted).sort((a, b) => { - return a.timestamp.toString().localeCompare(b.timestamp.toString()); - }); // 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 (other.timestamp.toString().localeCompare(message.timestamp.toString()) <= 0) continue; + if (new Date(other.timestamp.toString()).getTime() <= new Date(message.timestamp.toString()).getTime()) continue; if (other.messageReference?.message_id === message.id) { found.push(other); }