From 41b1dbdf6febc44b162f583eb614fad3ed8891d0 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Wed, 30 Oct 2024 00:57:58 +0300 Subject: frontend: fix switching maps but not updating --- frontend/src/api/Maps.tsx | 2 -- frontend/src/pages/Maps.tsx | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'frontend') diff --git a/frontend/src/api/Maps.tsx b/frontend/src/api/Maps.tsx index 80f88d4..fc50293 100644 --- a/frontend/src/api/Maps.tsx +++ b/frontend/src/api/Maps.tsx @@ -10,12 +10,10 @@ export const get_map_summary = async (map_id: string): Promise => { export const get_map_leaderboard = async (map_id: string): Promise => { const response = await axios.get(url(`maps/${map_id}/leaderboards`)); - console.log(response) if (!response.data.success) { return undefined; } const data = response.data.data; - console.log(data.records) // map the kind of leaderboard data.records = data.records.map((record: any) => { if (record.host && record.partner) { diff --git a/frontend/src/pages/Maps.tsx b/frontend/src/pages/Maps.tsx index 13ee4d9..bc939cf 100644 --- a/frontend/src/pages/Maps.tsx +++ b/frontend/src/pages/Maps.tsx @@ -37,8 +37,6 @@ const Maps: React.FC = ({ token, isModerator }) => { const _fetch_map_leaderboards = async () => { const mapLeaderboards = await API.get_map_leaderboard(mapID); - console.log("lbs:") - console.log(mapLeaderboards); setMapLeaderboardData(mapLeaderboards); }; @@ -51,7 +49,7 @@ const Maps: React.FC = ({ token, isModerator }) => { _fetch_map_summary(); _fetch_map_leaderboards(); _fetch_map_discussions(); - }, []); + }, [mapID]); if (!mapSummaryData) { // loading placeholder -- cgit v1.2.3