diff options
| author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-29 10:57:57 +0800 |
|---|---|---|
| committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-29 10:57:57 +0800 |
| commit | 996d99f533e8dcc8aa4a471097f5d6a93de894f4 (patch) | |
| tree | 4a965697b77983f07457c2498c08738d0d2624c9 /src/features/hud | |
| parent | 62b3e2b485fc576b5c3ca90035e44b29fdf48ae3 (diff) | |
| download | SoopyV2-996d99f533e8dcc8aa4a471097f5d6a93de894f4.tar.gz SoopyV2-996d99f533e8dcc8aa4a471097f5d6a93de894f4.tar.bz2 SoopyV2-996d99f533e8dcc8aa4a471097f5d6a93de894f4.zip | |
fix api cant find current profile
Diffstat (limited to 'src/features/hud')
| -rw-r--r-- | src/features/hud/index.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/features/hud/index.js b/src/features/hud/index.js index fad13c5..bd211e6 100644 --- a/src/features/hud/index.js +++ b/src/features/hud/index.js @@ -676,10 +676,10 @@ class Hud extends Feature { this.potsHudElement.setText(text) } - updatePotsData(data) { + updatePotsData(data, lastSave) { this.potsExpireAt = {} let now = Date.now() - if (Date.now() - data.last_save < 5 * 60000) now = data.last_save + if (Date.now() - lastSave < 5 * 60000) now = lastSave data.active_effects.forEach(e => { this.potsExpireAt[e.effect] = { level: e.level, @@ -690,14 +690,16 @@ class Hud extends Feature { } statApiLoadThingo(data) { + let lastSave = 0 data.profiles.forEach(p => { - if (!this.lastStatData || (p.members[Player.getUUID().toString().replace(/-/g, "")] && p.members[Player.getUUID().toString().replace(/-/g, "")].last_save > this.lastStatData.last_save)) { + if (!this.lastStatData || p.selected) { this.lastStatData = p.members[Player.getUUID().toString().replace(/-/g, "")] + lastSave = p.last_save } }) if (this.lastStatData) { - this.updatePotsData(this.lastStatData) + this.updatePotsData(this.lastStatData, lastSave) if (this.lastStatData.soulflow) this.apiSoulflow = true if (this.apiSoulflow) this.soulflowElement.setText("&6Soulflow&7> &f" + this.numberUtils.numberWithCommas(this.lastStatData.soulflow)) |
