add group by for hatchable sort (#11459)

* add group by for hatchable sort

* fix display bug when pets are owned
This commit is contained in:
Adam Fitzgibbon 2019-11-01 13:00:59 -05:00 committed by Matteo Pagliazzi
parent dfd79c9c1a
commit cf00bddd6f

View file

@ -767,7 +767,6 @@ export default {
case 'sortByHatchable': {
if (isPetList) {
const sortFunc = i => (i.isHatchable() ? 0 : 1);
animals = _sortBy(animals, [sortFunc]);
}
break;
@ -800,8 +799,10 @@ export default {
groupKey = 'potionKey';
} else if (sortBy === 'AZ') {
groupKey = '';
} else if (sortBy === 'sortByHatchable') {
groupKey = i => (i.isHatchable() ? 0 : 1);
}
return groupBy(pets, groupKey);
},
mounts (animalGroup, hideMissing, sortBy, searchText) {