From eca88c62b7958d071d1200e50a296f90aa2427cb Mon Sep 17 00:00:00 2001 From: Junho jeon Date: Mon, 18 Dec 2023 16:12:16 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20api=20=EC=B5=9C=EC=A0=81=ED=99=94=20#11?= =?UTF-8?q?59?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/modal/tournament/TournamentRegistryModal.tsx | 5 ++--- pages/tournament.tsx | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/modal/tournament/TournamentRegistryModal.tsx b/components/modal/tournament/TournamentRegistryModal.tsx index 15fa81a42..3e1a0d3b5 100644 --- a/components/modal/tournament/TournamentRegistryModal.tsx +++ b/components/modal/tournament/TournamentRegistryModal.tsx @@ -100,14 +100,13 @@ export default function TournamentRegistryModal({ }, [tournamentId]); useEffect(() => { - getTournamentInfo(); getStatus(); setOpenDate(dateToKRLocaleTimeString(new Date(startTime))); setCloseDate(dateToKRLocaleTimeString(new Date(endTime))); }, []); useEffect(() => { - getTournamentInfo(); + if (registState !== 'LOADING') getTournamentInfo(); }, [registState]); const closeModalButtonHandler = () => { @@ -165,7 +164,7 @@ export default function TournamentRegistryModal({ { if (openTournamentId !== undefined) fetchTournamentGames(); + }, [openTournamentId, fetchTournamentGames]); + + useEffect(() => { if (containerRef.current) { const width = containerRef.current.clientWidth; const height = containerRef.current.clientHeight; setContainerSize({ width, height }); } - }, [openTournamentId]); + }, []); return (