Skip to content

Commit

Permalink
feat: 답변 페이지 수정 및 종료 시, 모달 에러 고치기 (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
hayamaster authored Nov 28, 2023
1 parent 3d32cac commit 88a96e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
13 changes: 5 additions & 8 deletions src/pages/ReviewReplyPage/components/ReviewReplyEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ReviewReplyEdit = () => {
const reviewId = parseInt(pathname.split('/').at(-1) as string)
const [initModal, setInitModal] = useState(true)
const labelRef = useRef<HTMLLabelElement>(null)
// const hasMounted = useRef(false)
const hasMounted = useRef(false)

const { data: user } = useUser()
const { data: reviewData } = useGetReviewForParticipation({ id: reviewId })
Expand Down Expand Up @@ -54,15 +54,12 @@ const ReviewReplyEdit = () => {
})

useEffect(() => {
// NOTE: 개발 서버에서는 필요
// if (!hasMounted.current) {
// hasMounted.current = true

// return
// }

if (hasMounted.current) {
return
}
if (labelRef.current) {
labelRef.current.click()
hasMounted.current = true
}
}, [])

Expand Down
13 changes: 5 additions & 8 deletions src/pages/ReviewReplyPage/components/ReviewReplyEnd/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ReviewReplyEnd = () => {
const reviewId = parseInt(pathname.split('/').at(-1) as string)
const [initModal, setInitModal] = useState(true)
const labelRef = useRef<HTMLLabelElement>(null)
// const hasMounted = useRef(false)
const hasMounted = useRef(false)

const { data: user } = useUser()
const { data: prevReplyData } = useGetResponseByResponserForParticipation({
Expand All @@ -44,15 +44,12 @@ const ReviewReplyEnd = () => {
})

useEffect(() => {
// NOTE: 개발 서버에서는 필요
// if (!hasMounted.current) {
// hasMounted.current = true

// return
// }

if (hasMounted.current) {
return
}
if (labelRef.current) {
labelRef.current.click()
hasMounted.current = true
}
}, [])

Expand Down

0 comments on commit 88a96e7

Please sign in to comment.