Updated on 2026-08-14
This commit is contained in:
parent
9b35e9cbac
commit
7e45260907
2 changed files with 7 additions and 11 deletions
|
|
@ -19,11 +19,7 @@ class OnboardingSaltPayHelper {
|
|||
manager: SaltPayActivationManager,
|
||||
): Result<Boolean> {
|
||||
return try {
|
||||
val status = manager.updateActivationStatus(
|
||||
amountToClaim = null,
|
||||
step = SaltPayActivationStep.None,
|
||||
).successOr { return it }
|
||||
|
||||
val status = manager.updateActivationStatus(null).successOr { return it }
|
||||
val isRegistrationCase = status.step != SaltPayActivationStep.Finished
|
||||
val isBackupCase = scanResponse.card.backupStatus?.isActive == false
|
||||
Result.Success(isRegistrationCase || isBackupCase)
|
||||
|
|
|
|||
|
|
@ -67,10 +67,7 @@ private fun handleOnboardingSaltPayAction(anyAction: Action, appState: () -> App
|
|||
|
||||
val state = getState()
|
||||
scope.launch {
|
||||
val updateResult = state.saltPayManager.updateActivationStatus(
|
||||
amountToClaim = state.amountToClaim,
|
||||
step = state.step,
|
||||
).successOr {
|
||||
val updateResult = state.saltPayManager.updateActivationStatus(state.amountToClaim).successOr {
|
||||
onException(it.error)
|
||||
return@launch
|
||||
}
|
||||
|
|
@ -146,15 +143,18 @@ private fun handleOnboardingSaltPayAction(anyAction: Action, appState: () -> App
|
|||
}
|
||||
is OnboardingSaltPayAction.RegisterKYC -> {
|
||||
val state = getState()
|
||||
store.dispatch(OnboardingSaltPayAction.SetStep(SaltPayActivationStep.KycWaiting))
|
||||
handleInProgress = true
|
||||
|
||||
scope.launch {
|
||||
registerKYCIfNeeded(state.saltPayManager, state.step).successOr {
|
||||
Timber.d("saltPayManager.registerKYC()")
|
||||
state.saltPayManager.registerKYC().successOr {
|
||||
onException(it.error)
|
||||
return@launch
|
||||
}
|
||||
|
||||
handleInProgress = false
|
||||
withMainContext { store.dispatch(OnboardingSaltPayAction.Update) }
|
||||
dispatchOnMain(OnboardingSaltPayAction.Update)
|
||||
}
|
||||
}
|
||||
is OnboardingSaltPayAction.TrySetPin -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue