mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 07:18:38 +00:00
Fix asc/desc sort order when sorted by name (#11919)
* Fix asc/desc sort order when sorted by name * Revert changes. Use localeCompare but considering sort order
This commit is contained in:
parent
9220323483
commit
bdedf8f563
1 changed files with 7 additions and 1 deletions
|
|
@ -483,7 +483,13 @@ export default {
|
|||
// 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),
|
||||
(a, b) => {
|
||||
if (this.sortOption.direction === 'desc') {
|
||||
return b.profile.name.localeCompare(a.profile.name);
|
||||
}
|
||||
|
||||
return a.profile.name.localeCompare(b.profile.name);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
sortedMembers = orderBy(
|
||||
|
|
|
|||
Loading…
Reference in a new issue