diff options
-rw-r--r-- | src/hypixelCached.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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<CleanPr basicProfiles.push(basicProfile) } + basicProfiles.sort((a, b) => { + 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) |