File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
java/team/aliens/dms/android/feature/resetpassword Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,13 @@ fun AccountVerificationScreen(
8383 message = context.getString(R .string.reset_password_account_verification_account_id_does_not_exist),
8484 )
8585
86- ResetPasswordSideEffect .EmailVerificationTooManyRequest -> toast.showErrorToast(
87- message = context.getString(R .string.reset_password_account_verification_error_too_many_request ),
86+ ResetPasswordSideEffect .EmailVerificationUserNotFound -> toast.showErrorToast(
87+ message = context.getString(R .string.reset_password_account_verification_error_user_not_found ),
8888 )
8989
9090 ResetPasswordSideEffect .SendEmailVerificationCodeSuccess -> navigator.openResetPasswordEnterEmailVerificationCode()
9191
92- else -> { /* explicit blank */
93- }
92+ else -> { /* explicit blank */ }
9493 }
9594 }
9695
Original file line number Diff line number Diff line change 11package team.aliens.dms.android.feature.resetpassword
22
3+ import android.util.Log
34import androidx.lifecycle.viewModelScope
45import dagger.hilt.android.lifecycle.HiltViewModel
56import kotlinx.coroutines.Dispatchers
@@ -112,17 +113,17 @@ class ResetPasswordViewModel @Inject constructor(
112113 }
113114
114115 private fun sendEmailVerificationCode (email : String ) =
115- runCatching {
116- viewModelScope.launch( Dispatchers . IO ) {
116+ viewModelScope.launch( Dispatchers . IO ) {
117+ runCatching {
117118 authRepository.sendEmailVerificationCode(
118119 email = email,
119120 type = EmailVerificationType .PASSWORD ,
120121 )
122+ }.onSuccess {
123+ postSideEffect(ResetPasswordSideEffect .SendEmailVerificationCodeSuccess )
124+ }.onFailure {
125+ postSideEffect(ResetPasswordSideEffect .EmailVerificationUserNotFound )
121126 }
122- }.onSuccess {
123- postSideEffect(ResetPasswordSideEffect .SendEmailVerificationCodeSuccess )
124- }.onFailure {
125- postSideEffect(ResetPasswordSideEffect .EmailVerificationTooManyRequest )
126127 }
127128
128129 private fun updateEmailVerificationCode (value : String ) = run {
@@ -244,5 +245,5 @@ sealed class ResetPasswordSideEffect : SideEffect() {
244245 data object EmailVerificationCodeIncorrect : ResetPasswordSideEffect ()
245246 data object EmailVerificationSessionReset : ResetPasswordSideEffect ()
246247 data object EmailVerificationSessionResetFailed : ResetPasswordSideEffect ()
247- data object EmailVerificationTooManyRequest : ResetPasswordSideEffect ()
248+ data object EmailVerificationUserNotFound : ResetPasswordSideEffect ()
248249}
Original file line number Diff line number Diff line change 377377 <string name =" reset_password_account_verification_success_account_id_matches_email" >아이디와 일치하는 이메일입니다</string >
378378 <string name =" reset_password_account_verification_enter_account_id_invalid_format" >아이디 형식이 일치하지 않습니다.</string >
379379 <string name =" reset_password_account_verification_error_too_many_request" >요청이 너무 많습니다 잠시 후 다시 시도해주세요</string >
380+ <string name =" reset_password_account_verification_error_user_not_found" >존재하지 않는 아이디입니다.</string >
380381 <string name =" reset_password_account_verification_enter_student_name" >이름 입력</string >
381382 <string name =" reset_password_account_verification_enter_email" >이메일 입력</string >
382383 <string name =" reset_password_set_password_password_success_changed" >비밀번호가 변경되었습니다.</string >
You can’t perform that action at this time.
0 commit comments