1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 18:06:22 +00:00

sort messages in ascending order

This commit is contained in:
newwares 2024-03-13 14:53:37 -04:00
parent 2d779ba744
commit a96e69fae5

View file

@ -45,7 +45,7 @@ export default definePlugin({
channel: ChannelStore.getChannel(message.channel_id),
onClick: async () => {
const messages: Array<Message & { deleted?: boolean; }> = [...MessageStore.getMessages(message.channel_id)?._array ?? []].filter(m => !m.deleted).sort((a, b) => {
return b.timestamp.toString().localeCompare(a.timestamp.toString());
return a.timestamp.toString().localeCompare(b.timestamp.toString());
}); // Need to deep copy Message array when sorting
console.log(messages);
let reply: Message | null = null;