Updated on 2026-08-14

This commit is contained in:
Tangem 2024-01-16 23:12:35 +03:00
parent 1d2052e235
commit ae6ddfbeda
6 changed files with 45 additions and 14 deletions

View file

@ -120,6 +120,7 @@ class DialogManager : StoreSubscriber<GlobalState> {
onReject = state.dialog.onReject,
)
}
is BackupDialog.AttestationFailed -> AttestationFailedDialog.create(context)
is BackupDialog.AddMoreBackupCards -> AddMoreBackupCardsDialog.create(context)
is BackupDialog.BackupInProgress -> BackupInProgressDialog.create(context)
is BackupDialog.UnfinishedBackupFound -> UnfinishedBackupFoundDialog.create(context)

View file

@ -21,7 +21,7 @@ import com.tangem.domain.models.scan.CardDTO
import com.tangem.domain.models.scan.KeyWalletPublicKey
import com.tangem.operations.CommandResponse
import com.tangem.operations.backup.PrimaryCard
import com.tangem.operations.backup.StartPrimaryCardLinkingTask
import com.tangem.operations.backup.StartPrimaryCardLinkingCommand
import com.tangem.operations.derivation.DeriveMultipleWalletPublicKeysTask
import com.tangem.operations.derivation.ExtendedPublicKeysMap
import com.tangem.operations.wallet.CreateWalletTask
@ -210,7 +210,7 @@ private class CreateWalletTangemWallet(
session: CardSession,
callback: (result: CompletionResult<CreateProductWalletTaskResponse>) -> Unit,
) {
StartPrimaryCardLinkingTask().run(session) { result ->
StartPrimaryCardLinkingCommand().run(session) { result ->
when (result) {
is CompletionResult.Success -> {
primaryCard = result.data

View file

@ -373,17 +373,22 @@ private fun handleBackupAction(appState: () -> AppState?, action: BackupAction)
}
is CompletionResult.Failure -> {
val error = result.error
if (error is TangemSdkError.BackupFailedNotEmptyWallets &&
// todo disabled this check in task with shiba ([REDACTED_TASK_KEY]) and added canSkipBackup
// && onboardingWalletState.wallet2State != null
card?.canSkipBackup == false
) {
store.dispatchOnMain(
GlobalAction.ShowDialog(
BackupDialog.ResetBackupCard(error.cardId),
),
)
when (val error = result.error) {
is TangemSdkError.BackupFailedNotEmptyWallets -> {
if (card?.canSkipBackup == false) {
store.dispatchOnMain(
GlobalAction.ShowDialog(
BackupDialog.ResetBackupCard(error.cardId),
),
)
}
}
is TangemSdkError.IssuerSignatureLoadingFailed -> {
store.dispatchOnMain(
GlobalAction.ShowDialog(BackupDialog.AttestationFailed),
)
}
else -> Unit
}
}
}

View file

@ -90,6 +90,7 @@ sealed class BackupStep {
}
sealed class BackupDialog : StateDialog {
object AttestationFailed : BackupDialog()
object AddMoreBackupCards : BackupDialog()
object BackupInProgress : BackupDialog()
object UnfinishedBackupFound : BackupDialog()

View file

@ -0,0 +1,24 @@
package com.tangem.tap.features.onboarding.products.wallet.ui.dialogs
import android.content.Context
import androidx.appcompat.app.AlertDialog
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.store
import com.tangem.wallet.R
internal object AttestationFailedDialog {
fun create(context: Context): AlertDialog {
return MaterialAlertDialogBuilder(context, R.style.CustomMaterialDialog).apply {
setTitle(R.string.attestation_online_failed_title)
setMessage(R.string.attestation_online_failed_body)
setPositiveButton(R.string.ok) { dialog, _ ->
dialog.dismiss()
}
setOnDismissListener {
store.dispatch(GlobalAction.HideDialog)
}
}.create()
}
}

View file

@ -87,7 +87,7 @@ spr-client = "3.6.2"
# region Tangem
tangemBlockchainSdk = "develop-444"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "develop-317"
tangemCardSdk = "develop-318"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
# endregion Tangem