mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 02:05:28 +00:00
Refactor MemberSidebar user sorting logic
This commit is contained in:
@@ -98,6 +98,7 @@ function useEntries(
|
|||||||
const sort = member?.nickname ?? u.username;
|
const sort = member?.nickname ?? u.username;
|
||||||
const entry = [u, sort] as [User, string];
|
const entry = [u, sort] as [User, string];
|
||||||
|
|
||||||
|
if (member?.hasPermission(channel, "ViewChannel") || channel.recipient_ids?.includes(u._id)) {
|
||||||
if (!u.online || u.status?.presence === "Invisible") {
|
if (!u.online || u.status?.presence === "Invisible") {
|
||||||
categories.offline.push(entry);
|
categories.offline.push(entry);
|
||||||
} else {
|
} else {
|
||||||
@@ -122,6 +123,8 @@ function useEntries(
|
|||||||
|
|
||||||
categories.online.push(entry);
|
categories.online.push(entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.keys(categories).forEach((key) =>
|
Object.keys(categories).forEach((key) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user