Skip to content

Commit

Permalink
feature-060: 로그인 후 카테고리 사이드 바 최신화 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
gs0428 committed Feb 12, 2024
1 parent aa3d177 commit b85d07b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { LoginRequest } from '@/models/user';
import { userTokenState } from '@/stores/user';

import { BlurBackground } from '@/styles/modals/common.style';
import useUpdateCategories from '@/hooks/useUpdateCategories';

const SignInPage: React.FC = () => {
const navigate = useNavigate();
Expand All @@ -30,6 +31,7 @@ const SignInPage: React.FC = () => {
const [isOpenErrorModal, setIsOpenErrorModal] = useState(false);
const [isOpenSignUpModal, setIsOpenSignUpModal] = useState(false);
const setUserToken = useSetRecoilState(userTokenState);
const { updateCategories } = useUpdateCategories();

const [loginInfo, setLoginInfo] = useState<LoginRequest>({
email: '',
Expand Down Expand Up @@ -63,7 +65,7 @@ const SignInPage: React.FC = () => {
const handleClickLoginButton = async () => {
try {
const { token } = (await loginAPI(loginInfo)).data.result;

await updateCategories();
setUserToken(token);
navigate('/');
} catch (error) {
Expand Down

0 comments on commit b85d07b

Please sign in to comment.