Updated on 2026-08-14
This commit is contained in:
parent
3b33b9753b
commit
76a9691e0d
4 changed files with 2 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ class CreateFirstTwinWalletTask : CardSessionRunnable<CreateWalletResponse> {
|
|||
callback: (result: CompletionResult<CreateWalletResponse>) -> Unit,
|
||||
) {
|
||||
val card = session.environment.card
|
||||
val publicKey = card?.getSingleWallet()?.publicKey
|
||||
val publicKey = card?.wallets?.firstOrNull()?.publicKey
|
||||
if (publicKey != null) {
|
||||
if (TwinsHelper.getTwinCardNumber(card.cardId) == TwinCardNumber.Second) {
|
||||
callback(CompletionResult.Failure(WrongTwinCard(TwinCardNumber.First)))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import com.tangem.domain.common.TwinsHelper
|
|||
import com.tangem.operations.wallet.CreateWalletResponse
|
||||
import com.tangem.operations.wallet.CreateWalletTask
|
||||
import com.tangem.operations.wallet.PurgeWalletCommand
|
||||
import com.tangem.tap.domain.extensions.getSingleWallet
|
||||
|
||||
class CreateSecondTwinWalletTask(
|
||||
private val firstPublicKey: String,
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class TwinCardsManager(
|
|||
): CompletionResult<CreateWalletResponse> {
|
||||
val task = CreateSecondTwinWalletTask(
|
||||
firstPublicKey = currentCardPublicKey!!,
|
||||
firstCardId = firstCardId,
|
||||
issuerKeys = issuerKeyPair,
|
||||
preparingMessage = preparingMessage,
|
||||
creatingWalletMessage = creatingWalletMessage,
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ import com.tangem.domain.common.TwinCardNumber
|
|||
import com.tangem.tap.tangemSdkManager
|
||||
import com.tangem.wallet.R
|
||||
|
||||
data class WrongTwinCard(private val twinCardNumber: TwinCardNumber) : TangemError {
|
||||
override val code: Int = 50005
|
||||
data class WrongTwinCard(private val twinCardNumber: TwinCardNumber) : TangemError(code = 50005) {
|
||||
override var customMessage: String = tangemSdkManager.getString(
|
||||
R.string.twin_error_same_card,
|
||||
twinCardNumber.number,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue