From d2795f3ac950535c9685493f2a87704b9120ddff Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 11 Mar 2021 16:44:34 -0600 Subject: [PATCH] fix(stats): bump level cap to 9999 and related corrections --- website/client/src/components/notifications.vue | 3 ++- website/client/src/components/settings/restoreModal.vue | 5 ++++- website/common/script/constants.js | 1 + website/common/script/fns/updateStats.js | 7 ++++++- website/common/script/index.js | 2 ++ website/server/libs/user/index.js | 4 +++- website/server/models/user/schema.js | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/website/client/src/components/notifications.vue b/website/client/src/components/notifications.vue index 936f053285..30d8447c58 100644 --- a/website/client/src/components/notifications.vue +++ b/website/client/src/components/notifications.vue @@ -115,6 +115,7 @@ import { toNextLevel } from '@/../../common/script/statHelpers'; import { shouldDo } from '@/../../common/script/cron'; import { onOnboardingComplete } from '@/../../common/script/libs/onboarding'; import { mapState } from '@/libs/store'; +import { MAX_LEVEL_HARD_CAP } from '@/../../common/script/constants'; import notifications from '@/mixins/notifications'; import guide from '@/mixins/guide'; @@ -651,7 +652,7 @@ export default { const lvlUps = afterLvl - beforeLvl; let exp = afterExp - beforeExp; - if (lvlUps > 0) { + if (lvlUps > 0 || afterLvl >= MAX_LEVEL_HARD_CAP) { let level = Math.trunc(beforeLvl); exp += toNextLevel(level); diff --git a/website/client/src/components/settings/restoreModal.vue b/website/client/src/components/settings/restoreModal.vue index 4df846839b..b770fb2a27 100644 --- a/website/client/src/components/settings/restoreModal.vue +++ b/website/client/src/components/settings/restoreModal.vue @@ -114,6 +114,7 @@