Updated on 2026-08-14
This commit is contained in:
parent
044b794535
commit
ff129db7af
2 changed files with 3 additions and 12 deletions
|
|
@ -71,7 +71,7 @@ internal class WalletSelectorMiddleware {
|
|||
refreshUserWalletsAmounts()
|
||||
}
|
||||
is WalletSelectorAction.ClearUserWallets -> {
|
||||
disableUserWalletsSaving()
|
||||
clearUserWalletsAndCloseError()
|
||||
}
|
||||
is WalletSelectorAction.AddWallet.Success,
|
||||
is WalletSelectorAction.AddWallet.Error,
|
||||
|
|
@ -296,12 +296,8 @@ internal class WalletSelectorMiddleware {
|
|||
}
|
||||
}
|
||||
|
||||
private fun disableUserWalletsSaving() = scope.launch {
|
||||
private fun clearUserWalletsAndCloseError() = scope.launch {
|
||||
clearUserWallets()
|
||||
.map {
|
||||
preferencesStorage.shouldSaveUserWallets = false
|
||||
preferencesStorage.shouldSaveAccessCodes = false
|
||||
}
|
||||
.doOnSuccess {
|
||||
store.dispatchWithMain(WalletSelectorAction.CloseError)
|
||||
popBackToHome()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.tangem.common.doOnFailure
|
|||
import com.tangem.common.doOnResult
|
||||
import com.tangem.common.doOnSuccess
|
||||
import com.tangem.common.flatMap
|
||||
import com.tangem.common.map
|
||||
import com.tangem.domain.models.scan.ScanResponse
|
||||
import com.tangem.tap.*
|
||||
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
||||
|
|
@ -63,16 +62,12 @@ internal class WelcomeMiddleware {
|
|||
|
||||
private fun disableUserWalletsSaving() = scope.launch {
|
||||
userWalletsListManager.clear()
|
||||
.flatMap { walletStoresManager.clear() }
|
||||
.flatMap { tangemSdkManager.clearSavedUserCodes() }
|
||||
.map {
|
||||
preferencesStorage.shouldSaveUserWallets = false
|
||||
preferencesStorage.shouldSaveAccessCodes = false
|
||||
}
|
||||
.doOnFailure { e ->
|
||||
Timber.e(e, "Unable to clear user wallets")
|
||||
}
|
||||
.doOnResult {
|
||||
// !!! Workaround !!!
|
||||
store.dispatchWithMain(WelcomeAction.CloseError)
|
||||
store.dispatchWithMain(NavigationAction.PopBackTo(AppScreen.Home))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue