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); }