Skip to content

Commit

Permalink
Sort by score in mobile version
Browse files Browse the repository at this point in the history
  • Loading branch information
olegsvs committed Dec 18, 2024
1 parent c9c01b2 commit 856e088
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/stats/components/LeaderboardMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fetchPlayers, fetchStats } from 'utils/api'
import { Player } from 'utils/types'
import PlayerStatMobile from './PlayerStatMobile'
import { Link } from 'react-router-dom'
import { getPlayerScore } from './Leaderboard'

export default function LeaderboardMobile() {
const { headerSize } = useScreenSize()
Expand Down Expand Up @@ -41,7 +42,7 @@ export default function LeaderboardMobile() {
)

const playersStatsSorted = playersStats.sort((a, b) => {
return b.map_position - a.map_position
return getPlayerScore(b) - getPlayerScore(a)
})

return (
Expand Down

0 comments on commit 856e088

Please sign in to comment.