From 996d99f533e8dcc8aa4a471097f5d6a93de894f4 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Thu, 29 Sep 2022 10:57:57 +0800 Subject: fix api cant find current profile --- src/features/dungeonSolvers/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/features/dungeonSolvers') diff --git a/src/features/dungeonSolvers/index.js b/src/features/dungeonSolvers/index.js index 4d4fb81..787879a 100644 --- a/src/features/dungeonSolvers/index.js +++ b/src/features/dungeonSolvers/index.js @@ -671,15 +671,15 @@ class DungeonSolvers extends Feature { let data = await fetch(`https://api.hypixel.net/skyblock/profiles?key=${this.FeatureManager.features["globalSettings"].class.apiKeySetting.getValue()}&uuid=${uuid}`).json() if (!data.success) return - let latestProfile = [0, undefined] + let latestProfile = undefined data.profiles.forEach(p => { - if (p.members[uuid].last_save > latestProfile[0]) { - latestProfile = [p.members[uuid].last_save, p.members[uuid].pets.some(pet => pet.type === "SPIRIT" && pet.tier === "LEGENDARY")] + if (p.selected) { + latestProfile = p.members[uuid].pets.some(pet => pet.type === "SPIRIT" && pet.tier === "LEGENDARY") } }) - if (latestProfile[1]) { + if (latestProfile) { this.firstDeathHadSpirit = true if (this.scoreCalculation.getValue()) ChatLib.chat(this.FeatureManager.messagePrefix + username + " has spirit pet!") } else { -- cgit