1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

fix timestamp

This commit is contained in:
newwares 2024-07-12 14:38:42 -04:00
parent 6992058bce
commit 7c65c728b1
No known key found for this signature in database
GPG key ID: 07032940362D08BB

View file

@ -43,12 +43,10 @@ let madeComponent = false;
function findReplies(message: Message) { function findReplies(message: Message) {
const messages: Array<Message & { const messages: Array<Message & {
deleted?: boolean; deleted?: boolean;
}> = [...MessageStore.getMessages(message.channel_id)?._array ?? []].filter(m => !m.deleted).sort((a, b) => { }> = [...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
return a.timestamp.toString().localeCompare(b.timestamp.toString());
}); // Need to deep copy Message array when sorting
const found: Message[] = []; const found: Message[] = [];
for (const other of messages) { 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) { if (other.messageReference?.message_id === message.id) {
found.push(other); found.push(other);
} }