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:
parent
2d779ba744
commit
a96e69fae5
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue