Skip to content

Commit bf908f9

Browse files
committed
changes requested
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
1 parent 32ff1d4 commit bf908f9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

apps/meteor/client/views/hooks/useMembersList.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ const getSortedMembers = (members: RoomMember[], useRealName = false) => {
3737
return isModeratorA ? -1 : 1;
3838
}
3939

40-
if (a.status === 'online' && b.status !== 'online') {
41-
return -1;
42-
}
43-
44-
if (a.status !== 'online' && b.status === 'online') {
45-
return 1;
40+
if ((a.status === 'online' || b.status === 'online') && a.status !== b.status) {
41+
return a.status === 'online' ? -1 : 1;
4642
}
4743

4844
if (useRealName && a.name && b.name) {
@@ -112,7 +108,7 @@ export const useMembersList = (options: MembersListOptions) => {
112108
return;
113109
}
114110

115-
updateMemberInCache(options, queryClient, role.u._id, role as any, type, useRealName);
111+
updateMemberInCache(options, queryClient, role.u._id, role as IRole, type, useRealName);
116112
});
117113
return unsubscribe;
118114
}, [options, queryClient, subscribeToNotifyLoggedIn, useRealName]);

0 commit comments

Comments
 (0)