From 4662253d0eed7a4e26ff34afc3eef15ba3bb4280 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:50:03 -0500 Subject: [PATCH] Fixed alpha sort in RecipeOrganizerPage (#1354) --- frontend/components/Domain/Recipe/RecipeOrganizerPage.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue b/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue index a581d670..85796ffc 100644 --- a/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue +++ b/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue @@ -84,7 +84,7 @@ export default defineComponent({ if (!props.items) return byLetter; - props.items.forEach((item) => { + props.items.sort((a, b) => a.name.localeCompare(b.name)).forEach((item) => { const letter = item.name[0].toUpperCase(); if (!byLetter[letter]) { byLetter[letter] = []; @@ -92,12 +92,6 @@ export default defineComponent({ byLetter[letter].push(item); }); - for (const key in byLetter) { - byLetter[key] = byLetter[key].sort((a, b) => { - return a.name.localeCompare(b.name); - }); - } - return byLetter; });