staging #462

Merged
edraft merged 35 commits from staging into master 2023-12-17 01:03:15 +01:00
Showing only changes of commit ba173a6743 - Show all commits

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, {