Updated on 2026-08-14

This commit is contained in:
Tangem 2023-09-14 12:54:04 +03:00
commit 03426b710a
2 changed files with 2 additions and 7 deletions

View file

@ -82,9 +82,6 @@ data class WalletState(
get() = primaryWalletStore?.walletsData
?.firstOrNull { it.currency !is Currency.Blockchain }
val shouldShowDetails: Boolean =
primaryWalletData?.status !is WalletDataModel.Unreachable
fun getWalletManager(currency: Currency?): WalletManager? {
if (currency?.blockchain == null) return null
return getWalletStore(currency)?.walletManager

View file

@ -190,9 +190,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), SafeStoreSubscriber<W
walletView.onNewState(state)
if (!state.shouldShowDetails) {
binding.toolbar.menu.removeItem(R.id.details_menu)
} else if (binding.toolbar.menu.findItem(R.id.details_menu) == null) {
if (binding.toolbar.menu.findItem(R.id.details_menu) == null) {
binding.toolbar.inflateMenu(R.menu.menu_wallet)
}
@ -336,6 +334,6 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), SafeStoreSubscriber<W
),
)
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
if (store.state.walletState.shouldShowDetails) inflater.inflate(R.menu.menu_wallet, menu)
inflater.inflate(R.menu.menu_wallet, menu)
}
}