mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
* Modified the sort for name to be case-insensitive * Added comments for added piece of code sorting members
This commit is contained in:
parent
0ac12cb6a5
commit
a49f95e1a5
1 changed files with 13 additions and 5 deletions
|
|
@ -479,11 +479,19 @@ export default {
|
|||
|
||||
if (!isEmpty(this.sortOption)) {
|
||||
// Use the memberlist filtered by searchTerm
|
||||
sortedMembers = orderBy(
|
||||
sortedMembers,
|
||||
[this.sortOption.value],
|
||||
[this.sortOption.direction],
|
||||
);
|
||||
if (this.sortOption.value === 'profile.name') {
|
||||
// If members are to be sorted by name, use localeCompare for case-
|
||||
// insensitive sort
|
||||
sortedMembers.sort(
|
||||
(a, b) => a.profile.name.localeCompare(b.profile.name),
|
||||
);
|
||||
} else {
|
||||
sortedMembers = orderBy(
|
||||
sortedMembers,
|
||||
[this.sortOption.value],
|
||||
[this.sortOption.direction],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return sortedMembers;
|
||||
|
|
|
|||
Loading…
Reference in a new issue