Refactor MemberSidebar user sorting logic

pull/1148/head
Ganni 2025-09-09 12:02:07 -04:00 committed by GitHub
parent 41f47a1a3f
commit 5dae2a95cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 21 deletions

View File

@ -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) =>