Skip to content

[ Bug ] 로그인 모달 닫힘 타이밍 개선 #20

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

Open
1 task
usbinn opened this issue Apr 13, 2025 · 2 comments · Fixed by #21
Open
1 task

[ Bug ] 로그인 모달 닫힘 타이밍 개선 #20

usbinn opened this issue Apr 13, 2025 · 2 comments · Fixed by #21
Assignees
Labels
🐞Bug 간단한 오류를 수정합니다.

Comments

@usbinn
Copy link

usbinn commented Apr 13, 2025

📝 에러 설명

파이어베이스의 구글 로그인 모달창이 닫히고 나서 isLoggedIn 상태가 업데이트되는데 1초 정도 지연이 있습니다.

🐞 에러 대상 및 상황

OS

Window

Version

11

Browser

Chrome

🌿 To-do

  • 구글 로그인 버튼 클릭 시 즉시 모달 닫히게 처리

📚 ETC

2025-04-13.005616.mp4
@usbinn usbinn added the 🐞Bug 간단한 오류를 수정합니다. label Apr 13, 2025
@hyun907 hyun907 self-assigned this Apr 13, 2025
@hyun907
Copy link
Contributor

hyun907 commented Apr 13, 2025

@usbinn 콘솔 디버깅 추적을 해봤는데,

로그인 버튼을 누르고 첫 번째 상태

needsRegistration: false
isLoggedIn: true
isRegistered: null // isRegistered 값이 아직 비동기 쿼리 전이라 판단되지 않아 null

이후 바로

needsRegistration: false
isLoggedIn: true
isRegistered: true

즉, isRegistered: null이라
needsRegistration은 계산상 false, 하지만 모달 로직은 이전 needsRegistration 상태 기반으로 열립니다.

그러고 나서 isRegistered: true가 되니까 닫힘이 느리게 발생하는 이슈 같습니다. 원인을 찾아서 금방 해결해보겠습니다!

@hyun907
Copy link
Contributor

hyun907 commented Apr 13, 2025

if (auth.isRegistered === null) return;

를 추가해보았으나, 파이어베이스 로그인 자체가 비동기 처리라 바로 닫히지 않는 것 같습니다. 대신, 로딩 UI를 보여주는 건 어떨지 제안드립니다.

@hyun907 hyun907 linked a pull request Apr 13, 2025 that will close this issue
6 tasks
@hyun907 hyun907 reopened this Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞Bug 간단한 오류를 수정합니다.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants