diff --git a/src/hooks/useGetUser.ts b/src/hooks/useGetUser.ts index e2d2031..cd1ea7c 100644 --- a/src/hooks/useGetUser.ts +++ b/src/hooks/useGetUser.ts @@ -12,11 +12,16 @@ export const useGetUser = () => { export const useGetUserProfile = () => { const user = useGetUser(); const userProfile = useAtomValue(userProfileAtom); - const [result, setResult] = useState<{ name: string; profileImage: string } | null>(null); + + const [result, setResult] = useState<{ name: string; profileImage: string } | null>( + userProfile.name === '' && userProfile.profileImage === '' ? null : userProfile, + ); useEffect(() => { if (user.isLogin) { setResult(userProfile); + } else { + setResult(null); } }, [user, userProfile]);