From 10906560f435333684082cd5e840d266da336b67 Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Fri, 6 Mar 2026 16:26:42 +0100 Subject: [PATCH] show mods in correct order --- src/routes/(app)/matches/[id]/+page.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/routes/(app)/matches/[id]/+page.svelte b/src/routes/(app)/matches/[id]/+page.svelte index 57f159d..9c47154 100644 --- a/src/routes/(app)/matches/[id]/+page.svelte +++ b/src/routes/(app)/matches/[id]/+page.svelte @@ -54,6 +54,8 @@ TB: 'bg-pink-500/20 text-pink-400 border-pink-500/30' }; + const MOD_ORDER = ['NM', 'HD', 'HR', 'DT', 'FM', 'TB']; + // Group mappool slots by category const groupedSlots = $derived(() => { if (!m.mappool?.slots) return {}; @@ -65,7 +67,10 @@ for (const cat of Object.keys(groups)) { groups[cat].sort((a: any, b: any) => a.orderInCategory - b.orderInCategory); } - return groups; + // Return entries sorted by canonical mod order + return Object.fromEntries( + MOD_ORDER.filter((cat) => groups[cat]).map((cat) => [cat, groups[cat]]) + ); }); // Match duration