diff options
Diffstat (limited to 'frontend/src/api')
| -rw-r--r-- | frontend/src/api/Api.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
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 | |||
| 145 | if (!response.data.success) { | 145 | if (!response.data.success) { |
| 146 | return undefined; | 146 | return undefined; |
| 147 | } | 147 | } |
| 148 | return response.data.data; | 148 | const data = response.data.data; |
| 149 | // map the kind of leaderboard | ||
| 150 | data.records = data.records.map((record: any) => { | ||
| 151 | if (record.host && record.partner) { | ||
| 152 | return { ...record, kind: 'multiplayer' }; | ||
| 153 | } else { | ||
| 154 | return { ...record, kind: 'singleplayer' }; | ||
| 155 | } | ||
| 156 | }); | ||
| 157 | // should be unreachable | ||
| 158 | return undefined; | ||
| 149 | }; | 159 | }; |
| 150 | 160 | ||
| 151 | // MAP DISCUSSIONS | 161 | // MAP DISCUSSIONS |