diff --git a/src/apis/challenge/postCreateChallenge.ts b/src/apis/challenge/postCreateChallenge.ts index 6b7c989..8311dfc 100644 --- a/src/apis/challenge/postCreateChallenge.ts +++ b/src/apis/challenge/postCreateChallenge.ts @@ -23,7 +23,7 @@ export const useCreateChallenge = () => { mutationFn: () => postCreateChallenge(challengeDate), onSettled: () => queryClient.invalidateQueries({ - queryKey: [API.CHALLENGE.STARTDATE], + queryKey: [API.CHALLENGE.TODAY], }), }); }; diff --git a/src/pages/MainPage.tsx b/src/pages/MainPage.tsx index 427ee21..ea4955d 100644 --- a/src/pages/MainPage.tsx +++ b/src/pages/MainPage.tsx @@ -22,7 +22,12 @@ const MainPage = () => { const { openModal, isOpen } = useModalStore(); useEffect(() => { - if (!isOpen && !familyLoading && familyList?.length === 1) { + if ( + !isOpen && + !familyLoading && + familyList?.length === 1 && + queryData['code'] + ) { openModal({ content: , showCloseBtn: true,