mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +00:00
fix timestamp
This commit is contained in:
parent
6992058bce
commit
7c65c728b1
1 changed files with 2 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue