From 08eaa1198dc2d82c233b795e5d98ec0910d6871d Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 16 Mar 2023 05:33:11 -0700 Subject: [PATCH] Sort GW and DB raids correctly --- components/RaidDropdown/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/RaidDropdown/index.tsx b/components/RaidDropdown/index.tsx index a1ef9ad6..27becd91 100644 --- a/components/RaidDropdown/index.tsx +++ b/components/RaidDropdown/index.tsx @@ -99,7 +99,12 @@ const RaidDropdown = React.forwardRef( sortedRaids.length > 0 && sortedRaids[index].length > 0 && sortedRaids[index] - .sort((a, b) => a.element - b.element) + .sort((a, b) => { + if (a.element > 0 && b.element > 0) return a.element - b.element + else if (a.name.en.includes('NM') && b.name.en.includes('NM')) + return a.level < b.level ? -1 : 1 + else return a.name.en < b.name.en ? -1 : 1 + }) .map((item, i) => ( {item.name[locale]}