diff --git a/app/src/main/java/com/tangem/tap/features/tokens/redux/TokensState.kt b/app/src/main/java/com/tangem/tap/features/tokens/redux/TokensState.kt index 5476447c70..0bf2afeb58 100644 --- a/app/src/main/java/com/tangem/tap/features/tokens/redux/TokensState.kt +++ b/app/src/main/java/com/tangem/tap/features/tokens/redux/TokensState.kt @@ -61,7 +61,8 @@ fun List.filter(supportedBlockchains: Set?): List hideWarning() + BalanceStatus.VerifiedOnline, BalanceStatus.SameCurrencyTransactionInProgress -> hideWarning(isCustom) BalanceStatus.Loading -> { - hideWarning() + hideWarning(isCustom) if (wallet.currencyData.amountFormatted == null) { tvExchangeRate.text = root.getString(R.string.wallet_balance_loading) } } BalanceStatus.TransactionInProgress -> - showWarning(root.getString(R.string.wallet_balance_tx_in_progress)) + showWarning(root.getString(R.string.wallet_balance_tx_in_progress), isCustom) BalanceStatus.Unreachable -> - showWarning(root.getString(R.string.wallet_balance_blockchain_unreachable)) + showWarning(root.getString(R.string.wallet_balance_blockchain_unreachable), isCustom) BalanceStatus.NoAccount -> - showWarning(root.getString(R.string.wallet_error_no_account)) + showWarning(root.getString(R.string.wallet_error_no_account), isCustom) else -> { } } } - private fun showWarning(message: String) { - toggleWarning(true) + private fun showWarning(message: String, isCustom: Boolean = false) { + toggleWarning(true, isCustom) binding.tvStatusErrorMessage.text = message } - private fun hideWarning() { - toggleWarning(false) + private fun hideWarning(isCustom: Boolean = false) { + toggleWarning(false, isCustom) } - private fun toggleWarning(show: Boolean) { - binding.tvExchangeRate.show(!show) - binding.tvCustomCurrency.show(!show) + private fun toggleWarning(show: Boolean, isCustom: Boolean = false) { + if (!show) { + binding.tvExchangeRate.show(!isCustom) + binding.tvCustomCurrency.show(isCustom) + } else { + binding.tvExchangeRate.hide() + binding.tvCustomCurrency.hide() + } binding.tvStatusErrorMessage.show(show) } }