Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-17 17:58:08 +02:00
parent 3539e8272a
commit a74ee9640c
2 changed files with 3 additions and 5 deletions

View file

@ -259,7 +259,7 @@ class TradeCryptoMiddleware {
private fun openSwap(currency: CryptoCurrency) {
val bundle = bundleOf(
SwapFragment.CURRENCY_BUNDLE_KEY to Json.encodeToString(currency),
SwapFragment.CURRENCY_BUNDLE_KEY to currency
)
store.dispatchOnMain(NavigationAction.NavigateTo(screen = AppScreen.Swap, bundle = bundle))

View file

@ -50,10 +50,8 @@ internal class SwapViewModel @Inject constructor(
savedStateHandle: SavedStateHandle,
) : ViewModel(), DefaultLifecycleObserver {
private val initialCryptoCurrency = Json.decodeFromString<CryptoCurrency>(
savedStateHandle[SwapFragment.CURRENCY_BUNDLE_KEY]
?: error("no expected parameter Currency found"),
)
private val initialCryptoCurrency: CryptoCurrency = savedStateHandle[SwapFragment.CURRENCY_BUNDLE_KEY]
?: error("no expected parameter CryptoCurrency found`")
private var isBalanceHidden = true