Updated on 2026-08-14

This commit is contained in:
Tangem 2021-03-30 10:24:22 +03:00
parent 633186da8f
commit edb2613eec
3 changed files with 15 additions and 16 deletions

View file

@ -168,7 +168,7 @@ class TapWalletManager {
.mapNotNull { walletManagerFactory.makeWalletManager(data.card, it) }
val otherBlockhains = savedCurrencies.blockchains
val activeTokens = walletManagers.first { it.wallet.blockchain == Blockchain.Ethereum}
val activeTokens = walletManagers.first { it.wallet.blockchain == Blockchain.Ethereum }
.presetTokens.toList()
val tokens = activeTokens + savedCurrencies.tokens

View file

@ -126,22 +126,16 @@ class WalletMiddleware {
is WalletAction.Scan -> {
scope.launch {
val result = tangemSdkManager.scanNote(FirebaseAnalyticsHandler)
when (result) {
is CompletionResult.Success -> {
tangemSdkManager.changeDisplayedCardIdNumbersCount(result.data.card)
globalState?.tapWalletManager
?.onCardScanned(result.data, true)
if (walletState?.twinCardsState != null) {
val showOnboarding = !preferencesStorage.wasTwinsOnboardingShown()
if (showOnboarding) {
store.dispatch(NavigationAction.NavigateTo(AppScreen.TwinsOnboarding))
}
scope.launch(Dispatchers.Main) {
when (result) {
is CompletionResult.Success -> {
tangemSdkManager.changeDisplayedCardIdNumbersCount(result.data.card)
globalState?.tapWalletManager
?.onCardScanned(result.data, true)
store.dispatch(WalletAction.ScanCardFinished())
}
store.dispatch(WalletAction.ScanCardFinished())
}
is CompletionResult.Failure -> {
if (result.error !is TangemSdkError.UserCancelled) {
scope.launch(Dispatchers.Main) {
is CompletionResult.Failure -> {
if (result.error !is TangemSdkError.UserCancelled) {
store.dispatch(WalletAction.ScanCardFinished(result.error))
if (store.state.walletState.scanCardFailsCounter >= 2) {
store.dispatch(WalletAction.ShowDialog.ScanFails)

View file

@ -6,6 +6,8 @@ import android.view.ViewGroup
import android.widget.Button
import androidx.recyclerview.widget.LinearLayoutManager
import com.tangem.tap.common.extensions.*
import com.tangem.tap.common.redux.navigation.AppScreen
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.twins.TwinCardNumber
import com.tangem.tap.features.wallet.models.PendingTransaction
import com.tangem.tap.features.wallet.redux.*
@ -105,6 +107,9 @@ class SingleWalletView : WalletView {
this.tv_twin_card_number.hide()
this.iv_twin_card.hide()
}
if (twinCardsState?.showTwinOnboarding == true) {
store.dispatch(NavigationAction.NavigateTo(AppScreen.TwinsOnboarding))
}
}
}