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