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.
This commit is contained in:
kyuuseiryuu 2026-03-03 01:04:29 +09:00
parent 9e892f6ed1
commit 7f8196249b

View File

@ -31,7 +31,7 @@ export const GroupingPrediction: React.FC<Props> = 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(() => {