fix: 데스크탑 스페이스 생성 시 커스텀 회고 템플릿 질문 수정 기능 개선#789
Hidden character warning
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
영상은 용량 관계로 업로드하지 못했습니다. |
|
|
||
| useEffect(() => { | ||
| // * 이미 질문이 수정된 상태라면 원본으로 덮어쓰지 않음 | ||
| if (retroCreateData.hasChangedOriginal) return; |
| })); | ||
| } | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [editingQuestions, isAddMode]); |
There was a problem hiding this comment.
코드로만 봤을 때는 editingQuestions 가 변경되면 내부적으로 모드에 대한 처리가 들어간 것 같은데,
의존성 배열에 editingQuestions 도 필수로 필요한거죠?!
There was a problem hiding this comment.
주의 주석은 불필요해서 제거했습니다.
editingQuestions는 useEffect 문 내부의 handleCancel이 있는데요!
handleCancel은 editingQuestions를 사용하고 있습니다.
editingQuestions가 변경될 때마다 컴포넌트가 리렌더링되고,
새로운 handleCancel이 생성되고 이때 최신 editingQuestions를 참조합니다.
그래서 필요합니다!
++ 허허... 이쪽 코드가 많이 복잡한 것 같아요..
제 코드 기준 리팩토링 1순위로 보이네요..!!
시간날 때마다 천천히 작업해볼게요!
🏄🏼♂️ Summary (요약)
🫨 Describe your Change (변경사항)
QuestionEditSection/index.tsx
editingQuestions)를 도입하여 수정 중인 질문들을 관리handleComplete에서만 atom에 최종 반영되도록 수정handleCancel함수 추가: 변경사항이 있을 경우 확인 모달 표시 후 취소 처리useEffect로 모달의 뒤로가기 버튼 콜백을handleCancel로 설정MainQuestionsContents.tsx
handleContentChange를 props로 받도록 변경 (기존: 컴포넌트 내부에서 atom 직접 업데이트)handleTextareaChange로 리네이밍하여 textarea 높이 조절만 담당ConfirmDefaultTemplate.tsx
hasChangedOriginal이 true일 경우 API 원본 데이터로 덮어쓰지 않도록 조건 추가🧐 Issue number and link (참고)
📚 Reference (참조)