You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/flipcash/features/contact-verification/src/main/kotlin/com/flipcash/app/contact/verification/internal/phone/PhoneVerificationViewModel.kt
@@ -204,25 +205,35 @@ internal class PhoneVerificationViewModel @Inject constructor(
204
205
dispatchEvent(Event.OnVerifyingCodeChanged())
205
206
}
206
207
},
207
-
onError = {
208
-
trace(message ="Code verification failed: $it", type =TraceType.Error)
208
+
onError = { cause ->
209
+
trace(message ="Code verification failed: $cause", type =TraceType.Error)
209
210
dispatchEvent(Event.OnVerifyingCodeChanged())
210
-
val (title, message) =when (it) {
211
-
isPhoneVerificationError->when (it) {
211
+
val (title, message) =when (cause) {
212
+
isPhoneVerificationError->when (cause) {
212
213
isPhoneVerificationError.Denied->"Something went wrong" to "You have already sent a verification code"
213
214
isPhoneVerificationError.InvalidVerificationCode->"Something went wrong" to resources.getString(R.string.error_description_invalidVerificationCode)
214
215
isPhoneVerificationError.NoVerification->"Something went wrong" to resources.getString(R.string.error_description_codeTimedOut)
215
216
isPhoneVerificationError.RateLimited->"Something went wrong" to "Too many requests"
216
217
isPhoneVerificationError.UnsupportedPhoneType-> resources.getString(R.string.error_title_deviceNotSupported) to resources.getString(R.string.error_description_deviceNotSupported)
217
-
else->null to null
218
+
isPhoneVerificationError.InvalidPhoneNumber-> resources.getString(R.string.error_title_failedToSendCodeToPhone) to resources.getString(R.string.error_description_failedToSendCodeToPhone)
219
+
isPhoneVerificationError.Other-> resources.getString(R.string.error_title_failedToSendCodeToPhone) to resources.getString(R.string.error_description_failedToSendCodeToPhone)
220
+
isPhoneVerificationError.Unrecognized-> resources.getString(R.string.error_title_failedToSendCodeToPhone) to resources.getString(R.string.error_description_failedToSendCodeToPhone)
218
221
}
219
-
else->null to null
222
+
else->resources.getString(R.string.error_title_failedToSendCodeToPhone) to resources.getString(R.string.error_description_failedToSendCodeToPhone)
220
223
}
221
224
222
-
BottomBarManager.showError(
223
-
title = title ?: resources.getString(R.string.error_title_failedToSendCodeToPhone),
0 commit comments