settings_users: Directly use role value in sort_role.

There is no need to write a custom function for sorting
the users table by role since role values are according
to hierarchy of roles already.
This commit is contained in:
sahil839 2021-05-24 17:01:02 +05:30 committed by Tim Abbott
parent 10e9789179
commit c09e3fd845
1 changed files with 1 additions and 16 deletions

View File

@ -56,22 +56,7 @@ function sort_bot_email(a, b) {
} }
function sort_role(a, b) { function sort_role(a, b) {
function role(user) { return compare_a_b(a.role, b.role);
if (user.is_owner) {
return 0;
}
if (user.is_admin) {
return 1;
}
if (user.is_moderator) {
return 2;
}
if (user.is_guest) {
return 4;
}
return 3; // member
}
return compare_a_b(role(a), role(b));
} }
function sort_bot_owner(a, b) { function sort_bot_owner(a, b) {