From 188e806427ff6c9b302d994fc9c84a0300526688 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Mon, 9 Sep 2024 20:10:16 +0300
Subject: refactor: make names clickable throughout the site, fix user pages

---
 frontend/src/api/Api.tsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'frontend/src/api/Api.tsx')

diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.tsx
index 1f77088..30c0ad6 100644
--- a/frontend/src/api/Api.tsx
+++ b/frontend/src/api/Api.tsx
@@ -145,7 +145,17 @@ const get_map_leaderboard = async (map_id: string): Promise<MapLeaderboard | und
   if (!response.data.success) {
     return undefined;
   }
-  return response.data.data;
+  const data = response.data.data;
+  // map the kind of leaderboard
+  data.records = data.records.map((record: any) => {
+    if (record.host && record.partner) {
+      return { ...record, kind: 'multiplayer' };
+    } else {
+      return { ...record, kind: 'singleplayer' };
+    }
+  });
+  // should be unreachable
+  return undefined;
 };
 
 // MAP DISCUSSIONS
-- 
cgit v1.2.3

