Fix group candidates fuzzy filter

This commit is contained in:
Cohee
2024-12-06 23:04:18 +02:00
parent 51f89aaf7b
commit b8a9a55246
3 changed files with 14 additions and 11 deletions

View File

@@ -1265,7 +1265,7 @@ function getGroupCharacters({ doFilter, onlyMembers } = {}) {
const thisGroup = openGroupId && groups.find((x) => x.id == openGroupId);
let candidates = characters
.filter((x) => isGroupMember(thisGroup, x.avatar) == onlyMembers)
.map((x, index) => ({ item: x, id: index, type: 'character' }));
.map((x) => ({ item: x, id: characters.indexOf(x), type: 'character' }));
if (doFilter) {
candidates = groupCandidatesFilter.applyFilters(candidates);
@@ -1275,9 +1275,10 @@ function getGroupCharacters({ doFilter, onlyMembers } = {}) {
candidates.sort(sortMembersFn);
} else {
const useFilterOrder = doFilter && !!$('#rm_group_filter').val();
sortEntitiesList(candidates, useFilterOrder);
sortEntitiesList(candidates, useFilterOrder, groupCandidatesFilter);
}
groupCandidatesFilter.clearFuzzySearchCaches();
return candidates;
}