From 471578af779dcf4644179c5402f0e9e28cfbde0d Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Sat, 7 Mar 2026 17:15:06 +0100 Subject: [PATCH] always sort scores on win condition --- src/lib/components/Sidebar.svelte | 2 +- src/lib/server/match/engine.ts | 3 ++- src/routes/(app)/matches/[id]/+page.server.ts | 12 ++++++++++++ src/routes/(app)/matches/[id]/+page.svelte | 7 +------ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index 596328d..eff6861 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -110,7 +110,7 @@ { href: '/mappools', label: 'Mappools', icon: 'mappools' }, // { href: '/teams', label: 'Teams', icon: 'teams' }, { href: '/leaderboard', label: 'Leaderboard', icon: 'leaderboard' }, - ] as item} + ] as item (item.href)} - {#each [...game.scores].sort((a: any, b: any) => { - if (config.scoringType === 'accuracy') return b.accuracy - a.accuracy; - if (config.scoringType === 'combo') return b.maxCombo - a.maxCombo; - if (config.scoringType === 'pp') return (b.pp ?? 0) - (a.pp ?? 0); - return b.score - a.score; - }) as s} + {#each game.scores as s} {@const username = playerNames[s.player?.userId]}
{username ?? s.player?.userId ?? '?'}