Updated on 2026-08-14
This commit is contained in:
parent
6ef29ad028
commit
79341b957a
3 changed files with 11 additions and 9 deletions
|
|
@ -68,14 +68,12 @@ internal class AppCurrencySelectorViewModel @Inject constructor(
|
|||
.getOrNull()
|
||||
|
||||
getSelectedAppCurrencyUseCase().collectLatest { maybeSelectedCurrency ->
|
||||
maybeSelectedCurrency
|
||||
.onRight { selectedCurrency ->
|
||||
val selectedCurrencyIndex = availableCurrencies?.indexOfFirst { it == selectedCurrency }
|
||||
val selectedCurrency = maybeSelectedCurrency.getOrNull() ?: return@collectLatest
|
||||
val selectedCurrencyIndex = availableCurrencies?.indexOfFirst { it == selectedCurrency }
|
||||
|
||||
if (selectedCurrencyIndex != null && selectedCurrencyIndex != -1) {
|
||||
stateController.updateStateWithSelectedCurrency(selectedCurrency, selectedCurrencyIndex)
|
||||
}
|
||||
}
|
||||
if (selectedCurrencyIndex != null && selectedCurrencyIndex != -1) {
|
||||
stateController.updateStateWithSelectedCurrency(selectedCurrency, selectedCurrencyIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,6 +288,9 @@ internal class WalletSelectorMiddleware {
|
|||
}
|
||||
|
||||
private fun refreshUserWalletsAmounts() {
|
||||
val featureToggles = store.state.daggerGraphState.get(DaggerGraphState::walletFeatureToggles)
|
||||
if (featureToggles.isRedesignedScreenEnabled) return
|
||||
|
||||
scope.launch {
|
||||
walletStoresManager.updateAmounts(
|
||||
userWallets = userWalletsListManager.userWallets.firstOrNull().orEmpty(),
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.tangem.domain.redux.ReduxStateHolder
|
|||
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
||||
import com.tangem.domain.wallets.legacy.WalletsStateHolder
|
||||
import com.tangem.tap.common.entities.FiatCurrency
|
||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||
import com.tangem.tap.common.redux.AppState
|
||||
import com.tangem.tap.domain.TangemSdkManager
|
||||
import com.tangem.tap.domain.tokens.UserTokensRepository
|
||||
|
|
@ -53,13 +54,13 @@ class AppStateHolder @Inject constructor() : WalletsStateHolder, ReduxNavControl
|
|||
}
|
||||
|
||||
override fun navigate(action: NavigationAction) {
|
||||
mainStore?.dispatch(action)
|
||||
mainStore?.dispatchOnMain(action)
|
||||
}
|
||||
|
||||
override fun getBackStack(): List<AppScreen> = mainStore?.state?.navigationState?.backStack.orEmpty()
|
||||
|
||||
override fun popBackStack(screen: AppScreen?) {
|
||||
mainStore?.dispatch(NavigationAction.PopBackTo(screen))
|
||||
mainStore?.dispatchOnMain(NavigationAction.PopBackTo(screen))
|
||||
}
|
||||
|
||||
override fun dispatch(action: Action) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue