From 7249ab418cab5c65e7fab6312e52e11b749ed86c Mon Sep 17 00:00:00 2001
From: olegsvs <oleg.texet@gmail.com>
Date: Wed, 18 Dec 2024 12:05:30 +0300
Subject: [PATCH] Sort by score in mobile version

---
 src/pages/stats/components/LeaderboardMobile.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pages/stats/components/LeaderboardMobile.tsx b/src/pages/stats/components/LeaderboardMobile.tsx
index 911da294..15846de8 100644
--- a/src/pages/stats/components/LeaderboardMobile.tsx
+++ b/src/pages/stats/components/LeaderboardMobile.tsx
@@ -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()
@@ -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 (