Updated on 2026-08-14
This commit is contained in:
parent
faad8f15b5
commit
ccdbee3d0e
1 changed files with 7 additions and 1 deletions
|
|
@ -61,6 +61,7 @@ internal class MultiWalletFinalizeModel @Inject constructor(
|
|||
private val backupCardIds = backupServiceHolder.backupService.get()?.backupCardIds.orEmpty()
|
||||
|
||||
private var walletHasBackupError = false
|
||||
private var hasRing = false
|
||||
val uiState = _uiState.asStateFlow()
|
||||
val onBackFlow = MutableSharedFlow<Unit>()
|
||||
|
||||
|
|
@ -152,6 +153,7 @@ internal class MultiWalletFinalizeModel @Inject constructor(
|
|||
val primaryCardBatchId = backupService.primaryCardBatchId ?: return
|
||||
val isRing = isRing(primaryCardBatchId)
|
||||
val iconScanRes = if (isRing) R.drawable.img_hand_scan_ring else null
|
||||
if (isRing) hasRing = true
|
||||
|
||||
tangemSdkManager.changeProductType(isRing)
|
||||
backupService.proceedBackup(iconScanRes = iconScanRes) { result ->
|
||||
|
|
@ -178,6 +180,7 @@ internal class MultiWalletFinalizeModel @Inject constructor(
|
|||
val backupCardBatchId = backupService.backupCardsBatchIds.getOrNull(cardIndex) ?: return
|
||||
val isRing = isRing(backupCardBatchId)
|
||||
val iconScanRes = if (isRing) R.drawable.img_hand_scan_ring else null
|
||||
if (isRing) hasRing = true
|
||||
|
||||
tangemSdkManager.changeProductType(isRing)
|
||||
backupService.proceedBackup(iconScanRes = iconScanRes) { result ->
|
||||
|
|
@ -218,7 +221,6 @@ internal class MultiWalletFinalizeModel @Inject constructor(
|
|||
private fun finishBackup() {
|
||||
modelScope.launch {
|
||||
val scanResponse = params.multiWalletState.value.currentScanResponse
|
||||
|
||||
val userWalletCreated = createUserWallet(scanResponse)
|
||||
|
||||
val userWallet = when (params.parentParams.mode) {
|
||||
|
|
@ -249,6 +251,10 @@ internal class MultiWalletFinalizeModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
if (hasRing) {
|
||||
walletsRepository.setHasWalletsWithRing(userWallet.walletId)
|
||||
}
|
||||
|
||||
// save user wallet for manage tokens screen
|
||||
params.multiWalletState.update {
|
||||
it.copy(resultUserWallet = userWallet)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue