From 524cbd0680a3b04ab7f949d7cac3d5b265fed58c Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 21 May 2016 11:57:09 +0200 Subject: [PATCH] client/users: fix presenting user rank --- client/js/controllers/users_controller.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/js/controllers/users_controller.js b/client/js/controllers/users_controller.js index 96d609a..e0e8411 100644 --- a/client/js/controllers/users_controller.js +++ b/client/js/controllers/users_controller.js @@ -219,15 +219,14 @@ class UsersController { const myRankIdx = api.user ? api.allRanks.indexOf(api.user.rank) : 0; let ranks = {}; - for (let rankIdx of misc.range(api.allRanks.length)) { - const rankIdentifier = api.allRanks[rankIdx]; + for (let [rankIdx, rankIdentifier] of api.allRanks.entries()) { if (rankIdentifier === 'anonymous') { continue; } if (rankIdx > myRankIdx) { continue; } - ranks[rankIdentifier] = rankNames.values()[rankIdx]; + ranks[rankIdentifier] = rankNames.get(rankIdentifier); } if (isLoggedIn) {