Skip to content

Commit

Permalink
#56 Feat : 5번 이상 인증 실패 시 인증 실패 바텀 시트 노출
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Mar 4, 2024
1 parent 8ae1819 commit c439c4c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ fun SignUpAuthenticationScreen(
bottomSheetState.showBottomSheet {
AuthenticationFailedBottomSheet {
bottomSheetState.hideBottomSheet()
appState.navigate(AuthDestinations.Login.ROUTE) {
popUpTo(AuthDestinations.SignUp.ROUTE) {
inclusive = true
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class SignUpContract {
val verifyNumber: String = "",
val verifyNumberErrorState: Boolean = false,
val verifyNumberErrorText: String = "인증번호",
val verifyNumberErrorCount: Int = 0,
val isTimerRunning: Boolean = true,
val isTimeOut: Boolean = false,
val remainingTime: Int = VERIFY_NUMBER_TIMER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,23 @@ class SignUpViewModel @Inject constructor(
}

is ApiResult.ApiError -> {
updateState(currentState.copy(
verifyNumberErrorText = "인증번호를 확인해주세요!",
verifyNumberErrorState = true
))
val errorCount = currentState.verifyNumberErrorCount + 1

updateState(
currentState.copy(
verifyNumberErrorText = "인증번호를 확인해주세요!($errorCount/5)",
verifyNumberErrorState = true,
verifyNumberErrorCount = errorCount
)
)

if (errorCount > 4) {
postEffect(
SignUpContract.Effect.ShowBottomSheet(
SignUpContract.BottomSheet.AuthenticationFailed
)
)
}
}

else -> {
Expand Down

0 comments on commit c439c4c

Please sign in to comment.