@@ -69,6 +69,7 @@ const LikeCommentBottomSheetContent: React.FC<LikeCommentBottomSheetProps> = ({
6969
7070 const { postId } = useParams < { postId : string } > ( ) ;
7171 const nav = useNavigate ( ) ;
72+ const currentUserId = getCurrentUserId ( ) ;
7273
7374 // 댓글 메뉴 클릭한 경우
7475 const handleMenuOpen = ( comment : Comment , event : React . MouseEvent < HTMLButtonElement > ) => {
@@ -80,10 +81,7 @@ const LikeCommentBottomSheetContent: React.FC<LikeCommentBottomSheetProps> = ({
8081
8182 // 유저 클릭한 경우
8283 const handleUserClick = ( userId : number ) => {
83- // 로컬 스토리지에서 사용자 ID 가져오기
84- const myUserId = getCurrentUserId ( ) ; // 로컬 스토리지에 저장된 사용자 ID를 가져옴
85-
86- if ( String ( myUserId ) === String ( userId ) ) {
84+ if ( currentUserId === userId ) {
8785 // 나인 경우
8886 nav ( `/profile/${ userId } ` ) ;
8987 } else {
@@ -190,18 +188,16 @@ const LikeCommentBottomSheetContent: React.FC<LikeCommentBottomSheetProps> = ({
190188
191189 // 유저 차단 api
192190 const postUserBlock = async ( ) => {
193- const storedUserId = getCurrentUserId ( ) ;
194-
195191 // 사용자 ID 또는 선택된 댓글이 없으면 함수 종료
196- if ( ! storedUserId || ! selectedComment ) {
192+ if ( ! currentUserId || ! selectedComment ) {
197193 setModalContent ( '유저 정보를 찾을 수 없습니다.' ) ;
198194 setIsStatusModalOpen ( true ) ;
199195 return ;
200196 }
201197
202198 try {
203199 const blockRequest : PostUserBlockRequest = {
204- requesterId : Number ( storedUserId ) ,
200+ requesterId : currentUserId ,
205201 targetId : selectedComment . user . id ,
206202 action : 'block' ,
207203 } ;
0 commit comments