diff --git a/src/api.ts b/src/api.ts index 2017eda..eeb5e0c 100644 --- a/src/api.ts +++ b/src/api.ts @@ -524,8 +524,9 @@ function buildUpdates(data: Array): DynmapUpdates { } } + //Sort chat by newest first updates.chat = updates.chat.sort((one, two) => { - return one.timestamp - two.timestamp; + return two.timestamp - one.timestamp; }); console.debug(`Updates: ${accepted} accepted. Rejected: `, dropped);