From 7ac9e12332bba402d5ff2898735f331e5b291381 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 29 Mar 2022 15:30:33 +0000 Subject: sort profiles by last save probably --- src/hypixelCached.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index 5a17c3c..6e634ef 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -247,6 +247,13 @@ export async function fetchSkyblockProfiles(playerUuid: string): Promise { + const memberA = a.members?.find(m => m.uuid === playerUuid) + const memberB = b.members?.find(m => m.uuid === playerUuid) + if (!memberA || !memberB || !memberA.lastSave || !memberB.lastSave) return 0 + return memberB.lastSave - memberA.lastSave + }) + // cache the profiles profilesCache.set(playerUuid, basicProfiles) -- cgit