fix: Fallback to the last user level

This commit is contained in:
Alexander Polynomdivision 2018-10-09 13:19:14 +02:00
parent 15f05978a9
commit 6a8f0d1594

View File

@ -47,9 +47,5 @@ export const UserLevels: IUserLevel[] = [
export function userScoreToLevel(userScore: number): IUserLevel { export function userScoreToLevel(userScore: number): IUserLevel {
// NOTE: The failure level should never be returned // NOTE: The failure level should never be returned
return UserLevels.find((el) => userScore < el.levelCap) || { return UserLevels.find((el) => userScore < el.levelCap) || UserLevels[UserLevels.length - 1];
level: 0,
name: "Failure",
levelCap: 10000000,
};
} }