Fixed alpha sort in RecipeOrganizerPage (#1354)

This commit is contained in:
Michael Genson 2022-06-09 11:50:03 -05:00 committed by GitHub
parent 8836a258bd
commit 4662253d0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
});