Improved xp knob #409
All checks were successful
Deploy staging on push / pre-build (push) Successful in 2s
Deploy staging on push / build-bot (push) Successful in 3m4s
Deploy staging on push / build-web (push) Successful in 1m56s
Deploy staging on push / deploy (push) Successful in 26s

This commit is contained in:
Sven Heidemann 2023-12-10 19:50:44 +01:00
parent 84ff2a8a9b
commit ba173a6743

View File

@ -89,10 +89,6 @@ export class ProfileComponent implements OnInit, OnDestroy {
}
).subscribe(data => {
this.levels = data.levels.map(level => {
if (level.minXp && level.minXp > this.maxXp) {
this.maxXp = level.minXp;
}
return { label: level.name ?? "", value: level };
});
});
@ -119,8 +115,10 @@ export class ProfileComponent implements OnInit, OnDestroy {
this.router.navigate([`/server/${server.id}`]);
}
this.user = users.users[0];
const minXps = this.levels.reverse().map(x => x.value.minXp ?? 0);
this.maxXp = minXps.filter(x => this.user.xp && x > this.user.xp)[0] ?? this.user.xp;
if (this.user.level) {
this.activeLevelIndex = this.levels.reverse().map(l => l.value.id).indexOf(this.user.level.id) + 1;
this.activeLevelIndex = this.levels.map(l => l.value.id).indexOf(this.user.level.id) + 1;
}
this.data.query<UserWarningQuery>(Queries.userProfileWarnings, {