Improved xp knob #409
This commit is contained in:
parent
84ff2a8a9b
commit
ba173a6743
@ -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, {
|
||||
|
Loading…
Reference in New Issue
Block a user