Skip to content

Commit

Permalink
fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Dec 18, 2023
1 parent 517088b commit e6a7303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/sortByWeight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export default function sortByWeight(items: any[]) {
throw new Error("Item is not an array");
}

return items.sort((a, b) => a.weight || 99999 - b.weight || 99999);
return items.sort((a, b) => (a.weight || 99999) - (b.weight || 99999));
}

0 comments on commit e6a7303

Please sign in to comment.