Updated on 2026-08-14
This commit is contained in:
parent
e1f5d41f27
commit
275aa92b2c
3 changed files with 21 additions and 6 deletions
|
|
@ -42,13 +42,15 @@ object Dialogs {
|
|||
/**
|
||||
* Universal error dialog
|
||||
*/
|
||||
fun universalErrorDialog(universalError: UniversalError, onOkClick: () -> Unit): DialogMessage {
|
||||
fun universalErrorDialog(universalError: UniversalError, onDismiss: () -> Unit): DialogMessage {
|
||||
return DialogMessage(
|
||||
message = resourceReference(R.string.universal_error, wrappedList(universalError.errorCode)),
|
||||
firstAction = EventMessageAction(
|
||||
title = resourceReference(R.string.common_ok),
|
||||
onClick = onOkClick,
|
||||
onClick = {},
|
||||
),
|
||||
dismissOnFirstAction = true,
|
||||
onDismissRequest = onDismiss,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,6 @@ import com.tangem.core.decompose.ui.UiMessageSender
|
|||
import com.tangem.core.error.UniversalError
|
||||
import com.tangem.core.ui.message.dialog.Dialogs
|
||||
|
||||
fun UiMessageSender.showErrorDialog(universalError: UniversalError) {
|
||||
send(Dialogs.universalErrorDialog(universalError) {})
|
||||
fun UiMessageSender.showErrorDialog(universalError: UniversalError, onDismiss: () -> Unit = {}) {
|
||||
send(Dialogs.universalErrorDialog(universalError, onDismiss = onDismiss))
|
||||
}
|
||||
|
|
@ -72,14 +72,20 @@ internal class OnboardingVisaInProgressModel @Inject constructor(
|
|||
is VisaActivationRemoteState.CardWalletSignatureRequired,
|
||||
VisaActivationRemoteState.BlockedForActivation,
|
||||
-> {
|
||||
uiMessageSender.showErrorDialog(VisaActivationError.InconsistentRemoteState)
|
||||
uiMessageSender.showErrorDialog(VisaActivationError.InconsistentRemoteState) {
|
||||
retryShortPolling()
|
||||
}
|
||||
|
||||
analyticsEventHandler.send(
|
||||
VisaAnalyticsEvent.ErrorOnboarding(VisaActivationError.InconsistentRemoteState),
|
||||
)
|
||||
return@launch
|
||||
}
|
||||
VisaActivationRemoteState.Failed -> {
|
||||
uiMessageSender.showErrorDialog(VisaActivationError.FailedRemoteState)
|
||||
uiMessageSender.showErrorDialog(VisaActivationError.FailedRemoteState) {
|
||||
retryShortPolling()
|
||||
}
|
||||
|
||||
analyticsEventHandler.send(
|
||||
VisaAnalyticsEvent.ErrorOnboarding(VisaActivationError.FailedRemoteState),
|
||||
)
|
||||
|
|
@ -106,6 +112,13 @@ internal class OnboardingVisaInProgressModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun retryShortPolling() {
|
||||
modelScope.launch {
|
||||
delay(timeMillis = 10000)
|
||||
runShortPolling()
|
||||
}
|
||||
}
|
||||
|
||||
private suspend inline fun navigateToPinCodeIfNeeded(
|
||||
remoteState: VisaActivationRemoteState.AwaitingPinCode,
|
||||
complete: () -> Unit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue