Skip to content
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

[FE] feat: URL 모달이 떠있는 동안 뒤로가기, 새로고침 방지 #917

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

chysis
Copy link
Contributor

@chysis chysis commented Oct 23, 2024


🚀 어떤 기능을 구현했나요 ?

  • 홈페이지에서 리뷰 URL 생성 모달이 열려있을 때 뒤로가기 및 새로고침 시 confirm을 띄웁니다. URL 복사를 안 해뒀는데 뒤로 가거나 새로고침해서 사라진다면 슬프겠죠?

🔥 어떻게 해결했나요 ?

  • beforeunload 이벤트를 감지해서 페이지를 나갈 때나 새로고침할 때 confirm을 띄웁니다.
  • window.history를 사용하고 popstate 이벤트를 감지해서 뒤로가기할 때 confirm을 띄웁니다.

📝 어떤 부분에 집중해서 리뷰해야 할까요?

📚 참고 자료, 할 말

Copy link
Contributor

@BadaHertz52 BadaHertz52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.confirm 잘 뜨고 막는 거 확인했습니다.

Copy link
Contributor

@ImxYJL ImxYJL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL 모달은 잊고 있었는데 챙겨줘서 고마워요~

Copy link
Contributor

@soosoo22 soosoo22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고했어요!! 에프이!!!

@chysis chysis merged commit 422c048 into develop Oct 24, 2024
3 checks passed
skylar1220 pushed a commit that referenced this pull request Nov 5, 2024
* feat: URL 모달이 떠있는 동안 뒤로가기, 새로고침 방지

* fix: 뒤로가기 확인 시 모달만 닫히는 문제 수정
@donghoony donghoony deleted the fe/fix/911-url-modal branch November 17, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FE] URL 모달이 떠있을 때 뒤로가기나 새로고침을 막는다.
4 participants