client/users: fix presenting user rank

This commit is contained in:
rr- 2016-05-21 11:57:09 +02:00
parent df5d72d429
commit 524cbd0680
1 changed files with 2 additions and 3 deletions

View File

@ -219,15 +219,14 @@ class UsersController {
const myRankIdx = api.user ? api.allRanks.indexOf(api.user.rank) : 0; const myRankIdx = api.user ? api.allRanks.indexOf(api.user.rank) : 0;
let ranks = {}; let ranks = {};
for (let rankIdx of misc.range(api.allRanks.length)) { for (let [rankIdx, rankIdentifier] of api.allRanks.entries()) {
const rankIdentifier = api.allRanks[rankIdx];
if (rankIdentifier === 'anonymous') { if (rankIdentifier === 'anonymous') {
continue; continue;
} }
if (rankIdx > myRankIdx) { if (rankIdx > myRankIdx) {
continue; continue;
} }
ranks[rankIdentifier] = rankNames.values()[rankIdx]; ranks[rankIdentifier] = rankNames.get(rankIdentifier);
} }
if (isLoggedIn) { if (isLoggedIn) {