From eeab67611f16cfce112ac2779bb324d089a7c2fa Mon Sep 17 00:00:00 2001 From: Nidboj132 <28981031+Nidboj132@users.noreply.github.com> Date: Sun, 5 Nov 2023 20:27:51 +0100 Subject: feat: profile (#54) Former-commit-id: be6cd428190c05b2fa99e36c32765cc0fd4044e8 --- frontend/src/components/pages/summary.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'frontend/src/components/pages/summary.js') diff --git a/frontend/src/components/pages/summary.js b/frontend/src/components/pages/summary.js index c03d7b9..7c72c48 100644 --- a/frontend/src/components/pages/summary.js +++ b/frontend/src/components/pages/summary.js @@ -20,6 +20,7 @@ const fakedata={} //for debug //fetching data const [data, setData] = React.useState(null); React.useEffect(() => { + setData(null) fetch(`https://lp.ardapektezol.com/api/v1/maps/${location.pathname.split('/')[2]}/summary`) .then(r => r.json()) .then(d => { @@ -37,7 +38,7 @@ const fakedata={} //for debug .then(r => r.json()) .then(d => setLbData(d)) // eslint-disable-next-line - }, [pageNumber]); + }, [pageNumber,location.pathname]); @@ -247,7 +248,7 @@ return ( - + {data.map.game_name} {data.map.chapter_name} @@ -257,7 +258,7 @@ return ( - + setNavState(0)}>Summary setNavState(1)}>Leaderboards setNavState(2)}>Discussions -- cgit v1.2.3