From 4f70a6fbf4d6a488d7c8b259157fc2a04b17f86e Mon Sep 17 00:00:00 2001 From: Adam Fitzgibbon Date: Fri, 18 Nov 2022 14:44:58 -0800 Subject: [PATCH] now grouping the stable A-Z sortBy option by first letter so that Show More functionality works like the other sort types (#14304) --- .../src/components/inventory/stable/index.vue | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/website/client/src/components/inventory/stable/index.vue b/website/client/src/components/inventory/stable/index.vue index 9e1cedc34c..18f4ef1a6e 100644 --- a/website/client/src/components/inventory/stable/index.vue +++ b/website/client/src/components/inventory/stable/index.vue @@ -787,18 +787,15 @@ export default { if (sortBy === 'sortByColor') { groupKey = 'potionKey'; } else if (sortBy === 'AZ') { - groupKey = ''; + groupKey = i => i.eggName[0]; } else if (sortBy === 'sortByHatchable') { groupKey = i => (i.isHatchable() ? 0 : 1); } const groupedPets = groupBy(pets, groupKey); // Pets are rendered as grouped "rows". Count helps decide if show more button is necessary. - if (sortBy === 'AZ') { - this.petRowCount[animalGroup.key] = 1; - } else { - this.petRowCount[animalGroup.key] = Object.keys(groupedPets).length; - } + this.petRowCount[animalGroup.key] = Object.keys(groupedPets).length; + return groupedPets; }, mounts (animalGroup, hideMissing, sortBy, searchText) { @@ -814,14 +811,12 @@ export default { if (sortBy === 'sortByColor') { groupKey = 'potionKey'; } else if (sortBy === 'AZ') { - groupKey = ''; + groupKey = i => i.eggName[0]; } const groupedMounts = groupBy(mounts, groupKey); - if (sortBy === 'AZ') { - this.mountRowCount[animalGroup.key] = 1; - } else { - this.mountRowCount[animalGroup.key] = Object.keys(groupedMounts).length; - } + + this.mountRowCount[animalGroup.key] = Object.keys(groupedMounts).length; + return groupedMounts; }, // Actions