add sortByWhiteboardAccess to users in userlist

This commit is contained in:
KDSBrowne 2020-08-18 15:18:20 +00:00
parent 423a5fd1c2
commit bf4dece99f

View File

@ -46,6 +46,14 @@ export const setModeratorOnlyMessage = msg => Storage.setItem('ModeratorOnlyMess
const getCustomLogoUrl = () => Storage.getItem(CUSTOM_LOGO_URL_KEY);
const sortByWhiteboardAccess = (a, b) => {
const _a = a.whiteboardAccess;
const _b = b.whiteboardAccess;
if (!_b && _a) return -1;
if (!_a && _b) return 1;
return 0;
};
const sortUsersByName = (a, b) => {
const aName = a.name.toLowerCase();
const bName = b.name.toLowerCase();
@ -128,6 +136,10 @@ const sortUsers = (a, b) => {
sort = sortUsersByPhoneUser(a, b);
}
if (sort === 0) {
sort = sortByWhiteboardAccess(a, b);
}
if (sort === 0) {
sort = sortUsersByName(a, b);
}
@ -181,7 +193,8 @@ const sortChats = (a, b) => {
sort = sortChatsByName(a, b);
}
return sort = sortByRecentActivity(a, b);
sort = sortByRecentActivity(a, b);
return sort;
};
const userFindSorting = {