Skip to content
Snippets Groups Projects
Unverified Commit 5bdc1bb8 authored by Maxim Khlobystov's avatar Maxim Khlobystov Committed by GitHub
Browse files

Merge pull request #5805 from MaximKhlobystov/move-current-user-to-top

Move current user to the top of the users list.
parents 957a2ef0 fefec548
No related branches found
No related tags found
No related merge requests found
......@@ -92,8 +92,23 @@ const sortUsersByPhoneUser = (a, b) => {
return 0;
};
// current user's name is always on top
const sortUsersByCurrent = (a, b) => {
if (a.isCurrent) {
return -1;
} else if (b.isCurrent) {
return 1;
}
return 0;
};
const sortUsers = (a, b) => {
let sort = sortUsersByModerator(a, b);
let sort = sortUsersByCurrent(a, b);
if (sort === 0) {
sort = sortUsersByModerator(a, b);
}
if (sort === 0) {
sort = sortUsersByEmoji(a, b);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment