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:
parent
9e892f6ed1
commit
7f8196249b
@ -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(() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user