From 7f8196249ba9cac38c0c830686e66c84177fbde0 Mon Sep 17 00:00:00 2001 From: kyuuseiryuu Date: Tue, 3 Mar 2026 01:04:29 +0900 Subject: [PATCH] fix(grouping): guard nowScore with numeric check before fallback Use nowScore only when it can be parsed as a number, otherwise keep original score. Prevents invalid nowScore values from affecting grouping/sorting. --- src/components/GroupingPrediction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/GroupingPrediction.tsx b/src/components/GroupingPrediction.tsx index 47aef94..cfa0cc4 100644 --- a/src/components/GroupingPrediction.tsx +++ b/src/components/GroupingPrediction.tsx @@ -31,7 +31,7 @@ export const GroupingPrediction: React.FC = props => { const refactoredPlayers = useMemo(() => { return nowScoreGroup === OrderScore.当前积分 ? props.players?.map(e => ({ ...e, - score: e.nowScore ?? e.score, + score: !Number.isNaN(Number(e.nowScore)) ? e.nowScore : e.score, })) : [...props.players ?? []]; }, [nowScoreGroup, props.players]); const players = useMemo(() => {