-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: 여행일기 수정 시 날짜가 변경되는 오류 수정 & 뒤로가기 미동작 오류 수정 & 일기 글 내용 미표시 오류 수정 #54
Open
HyunJinNo
wants to merge
29
commits into
main
Choose a base branch
from
dev/#48
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
☑️ 개발 유형
✔️ PR 유형
📝 작업 내용
이번 PR에서 작업한 내용을 간략히 설명해주세요.
여행일기 수정 시 날짜를 변경하지 않았음에도 불구하고 날짜가 하루씩 변경되는 오류 수정
먼저 FE에서 BE로 전달하는 Date 객체는
2025-01-30T03:00:00.000Z
와 같은 형식으로 전달됩니다. 하지만 서버에서 전달받은 날짜 데이터는2025-01-30T03:00:00
와 같은 문자열로 전달됩니다. 해당 문자열을 Date로 변환하기 위해new Date(diary.startDatetime)
방식을 적용하였는데, 해당 방식을 적용한 결과2025-01-29T18:00:00.000Z
와 같이 날짜가 하루 뒤로 밀리는 문제가 발생하였습니다. 따라서 해당 문제를 해결하기 위해 명확한 시간대를 표시해야 하므로 다음과 같이 UTC 시간 기준임을 명시하여 문제를 해결하였습니다.BottomSheetModal이 리렌더링된 후 모바일 뒤로가기 버튼이 동작하지 않는 오류 수정
기존에 구현한 useBackHandler 커스텀 훅은 다음과 같이 작성되어 있었습니다.
위와 같이 구현한 결과 해당 커스텀 훅을 사용하는 컴포넌트가 리렌더링되는 경우 backAction, addBackPressEventListenter, removeBackPressEventListener 함수가 새롭게 정의되는 문제가 발생하여 모바일 뒤로가기 버튼이 정상적으로 동작하지 않는 문제가 발생하였습니다. 따라서 컴포넌트가 리렌더링되더라도 함수가 재정의되는 문제를 방지하기 위해 다음과 같이 useCallback 훅을 사용하였습니다.
여행일기 수정 화면으로 이동했을 때 일기 글 내용이 표시되지 않는 오류 수정
여행일기 수정 화면으로 이동했을 때 일기 내용이 표시될 수도 있고 표시되지 않는 경우가 있었습니다. 해당 문제를 해결하기 위해 다음과 같이 editor가 준비되었을 때 editor의 content를 초기화하도록 구현하였습니다.
#️⃣ Related Issue
해당 Pull Request과 관련된 Issue Link를 작성해 주세요
close #48
close #52
close #53