Skip to content

Commit

Permalink
fix: 비회원 댓글 남길경우 라우팅 안되던 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HoberMin committed Jul 16, 2024
1 parent 2473474 commit b1d65f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/(post)/result/[postId]/hooks/useCreateComment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use';
'use client';

import { useRouter } from 'next/navigation';

Expand All @@ -15,7 +15,7 @@ export const useCreateComment = (postId: string) => {
if (isLogin) {
await createComment(comment);
} else {
router.push('/signin');
setTimeout(() => router.push('/signin'), 0); // setTimeout 으로 우선순위를 높임
Toast.default('로그인이 필요합니다.');
}
};
Expand Down

0 comments on commit b1d65f9

Please sign in to comment.