mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-06 12:47:57 +01:00
Filter group candidates before mapping
This commit is contained in:
parent
1305f9dc4c
commit
3019b889cd
@ -939,8 +939,9 @@ function getGroupCharacters({ doFilter, onlyMembers } = {}) {
|
||||
}
|
||||
|
||||
const thisGroup = openGroupId && groups.find((x) => x.id == openGroupId);
|
||||
let candidates = characters.map((x, index) => ({ item: x, id: index, type: 'character' }));
|
||||
candidates = candidates.filter((x) => isGroupMember(thisGroup, x.item.avatar) == onlyMembers);
|
||||
let candidates = characters
|
||||
.filter((x) => isGroupMember(thisGroup, x.avatar) == onlyMembers)
|
||||
.map((x, index) => ({ item: x, id: index, type: 'character' }));
|
||||
|
||||
if (onlyMembers) {
|
||||
candidates.sort(sortMembersFn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user