-
Notifications
You must be signed in to change notification settings - Fork 1
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
[REFACTOR] 카카오 로그인 리팩토링 #299
Conversation
} | ||
} | ||
|
||
|
||
private fun initKakaoAccountLogin() { | ||
instance.loginWithKakaoAccount(contextRef.get()!!, callback = callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
카카오톡 로그인에 실패해서 카카오 계정으로 로그인 재시도했는데, 이것도 실패하면 어떻게 되나요??
그에 대한 처리를 이 부분에서 해줘야 하지 않을까 싶어서 여쭤봅니다!
app/src/main/java/com/runnect/runnect/presentation/login/KakaoLogin.kt
Outdated
Show resolved
Hide resolved
|
||
// 카카오톡에 연결된 카카오계정이 없는 경우, 카카오계정으로 로그인 시도 | ||
initKakaoAccountLogin() | ||
} else if (token != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 else if 대신에 early return 방식을 사용하면 코드가 조금 더 깔끔해질 거 같습니다!
if (error != null) {
// ...
// 여기서 early return
}
|
||
const val KAKAO_TALK_LOGIN_SUCCESS = "카카오톡으로 로그인 성공" | ||
const val KAKAO_TALK_LOGIN_FAILURE = "카카오톡으로 로그인 실패" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다른 곳에서 사용되지 않는 문자열이라면, 습관적으로 private 지정자도 붙여주는 게 좋을 거 같습니다!
9538b84
to
55b4ded
Compare
app/src/main/java/com/runnect/runnect/presentation/login/KakaoLogin.kt
Outdated
Show resolved
Hide resolved
private val contextRef = WeakReference(context) | ||
private val viewModelRef = WeakReference(viewModel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WeakReference
직접 사용하는 예시는 개인적으로 처음봤는데 덕분에 공부해봤습니다 👍
cd9553a
to
55b4ded
Compare
📌 개요
✨ 작업 내용
✨ PR 포인트
📸 스크린샷/동영상