Skip to content

Commit

Permalink
[fix] api 최적화 #1159
Browse files Browse the repository at this point in the history
  • Loading branch information
Junho jeon authored and Junho jeon committed Dec 18, 2023
1 parent 24d41d5 commit eca88c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions components/modal/tournament/TournamentRegistryModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -165,7 +164,7 @@ export default function TournamentRegistryModal({
<ModalButton
onClick={buttonHandler}
value={
player_cnt === 8 && registState === 'BEFORE'
playerCount === 8 && registState === 'BEFORE'
? '대기 등록'
: buttonContent
}
Expand Down
5 changes: 4 additions & 1 deletion pages/tournament.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ export default function Tournament() {

useEffect(() => {
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 (
<div className={styles.pageWrap}>
Expand Down

0 comments on commit eca88c6

Please sign in to comment.