Updated on 2026-08-14
This commit is contained in:
parent
f94f78eb48
commit
4bf16417fb
2 changed files with 6 additions and 29 deletions
|
|
@ -26,14 +26,9 @@ class TwinCardsManager(private val card: Card, assetReader: AssetReader) {
|
|||
private val issuerKeyPair: KeyPair = getIssuerKeys(assetReader, card.issuer.publicKey.toHexString())
|
||||
|
||||
suspend fun createFirstWallet(message: Message): CompletionResult<CreateWalletResponse> {
|
||||
val response = tangemSdkManager.runTaskAsync(
|
||||
CreateFirstTwinWalletTask(), currentCardId, message
|
||||
)
|
||||
val response = tangemSdkManager.runTaskAsync(CreateFirstTwinWalletTask(), currentCardId, message)
|
||||
when (response) {
|
||||
is CompletionResult.Success -> {
|
||||
currentCardPublicKey = response.data.wallet.publicKey.toHexString()
|
||||
return response
|
||||
}
|
||||
is CompletionResult.Success -> currentCardPublicKey = response.data.wallet.publicKey.toHexString()
|
||||
is CompletionResult.Failure -> {
|
||||
(response.error as? TangemSdkError)?.let { error ->
|
||||
FirebaseAnalyticsHandler.logCardSdkError(
|
||||
|
|
@ -42,13 +37,11 @@ class TwinCardsManager(private val card: Card, assetReader: AssetReader) {
|
|||
card = card
|
||||
)
|
||||
}
|
||||
return response
|
||||
}
|
||||
}
|
||||
|
||||
return response
|
||||
}
|
||||
|
||||
|
||||
suspend fun createSecondWallet(
|
||||
initialMessage: Message,
|
||||
preparingMessage: Message,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ private fun handle(action: Action, dispatch: DispatchFunction) {
|
|||
if (twinCardsState.mode == CreateTwinWalletMode.CreateWallet) {
|
||||
onboardingManager?.activationFinished(getScanResponse().card.cardId)
|
||||
twinCardsState.pairCardId?.let { onboardingManager?.activationFinished(it) }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -121,23 +120,9 @@ private fun handle(action: Action, dispatch: DispatchFunction) {
|
|||
}
|
||||
is TwinCardsAction.SetStepOfScreen -> {
|
||||
when (action.step) {
|
||||
TwinCardsStep.WelcomeOnly -> {
|
||||
preferencesStorage.saveTwinsOnboardingShown()
|
||||
}
|
||||
TwinCardsStep.Welcome -> {
|
||||
preferencesStorage.saveTwinsOnboardingShown()
|
||||
}
|
||||
TwinCardsStep.Warning -> {
|
||||
}
|
||||
TwinCardsStep.CreateFirstWallet -> {
|
||||
}
|
||||
TwinCardsStep.CreateSecondWallet -> {
|
||||
}
|
||||
TwinCardsStep.CreateThirdWallet -> {
|
||||
}
|
||||
TwinCardsStep.TopUpWallet -> {
|
||||
store.dispatch(TwinCardsAction.Balance.Update)
|
||||
}
|
||||
TwinCardsStep.WelcomeOnly -> preferencesStorage.saveTwinsOnboardingShown()
|
||||
TwinCardsStep.Welcome -> preferencesStorage.saveTwinsOnboardingShown()
|
||||
TwinCardsStep.TopUpWallet -> store.dispatch(TwinCardsAction.Balance.Update)
|
||||
TwinCardsStep.Done -> {
|
||||
finishCardActivation()
|
||||
postUi(500) { store.dispatch(TwinCardsAction.Confetti.Show) }
|
||||
|
|
@ -200,7 +185,6 @@ private fun handle(action: Action, dispatch: DispatchFunction) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
is TwinCardsAction.Balance.Update -> {
|
||||
val walletManager = if (twinCardsState.walletManager != null) {
|
||||
twinCardsState.walletManager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue