From 511740faa527b6a4c4dbd20d202c8dd385fd234c Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Fri, 6 Mar 2026 16:47:03 +0100 Subject: [PATCH] sort player scores based on selected scoring type in match results --- 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 9c47154..4c08a34 100644 --- a/src/routes/(app)/matches/[id]/+page.svelte +++ b/src/routes/(app)/matches/[id]/+page.svelte @@ -530,7 +530,12 @@ {#if game.state === 'FINISHED' && game.scores?.length > 0}
- {#each game.scores as s} + {#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} {@const username = playerNames[s.player?.userId]}
{username ?? s.player?.userId ?? '?'}