Updated on 2026-08-14
This commit is contained in:
parent
62a38299e7
commit
45a4887fb2
2 changed files with 2 additions and 7 deletions
|
|
@ -82,9 +82,6 @@ data class WalletState(
|
||||||
get() = primaryWalletStore?.walletsData
|
get() = primaryWalletStore?.walletsData
|
||||||
?.firstOrNull { it.currency !is Currency.Blockchain }
|
?.firstOrNull { it.currency !is Currency.Blockchain }
|
||||||
|
|
||||||
val shouldShowDetails: Boolean =
|
|
||||||
primaryWalletData?.status !is WalletDataModel.Unreachable
|
|
||||||
|
|
||||||
fun getWalletManager(currency: Currency?): WalletManager? {
|
fun getWalletManager(currency: Currency?): WalletManager? {
|
||||||
if (currency?.blockchain == null) return null
|
if (currency?.blockchain == null) return null
|
||||||
return getWalletStore(currency)?.walletManager
|
return getWalletStore(currency)?.walletManager
|
||||||
|
|
|
||||||
|
|
@ -190,9 +190,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), SafeStoreSubscriber<W
|
||||||
|
|
||||||
walletView.onNewState(state)
|
walletView.onNewState(state)
|
||||||
|
|
||||||
if (!state.shouldShowDetails) {
|
if (binding.toolbar.menu.findItem(R.id.details_menu) == null) {
|
||||||
binding.toolbar.menu.removeItem(R.id.details_menu)
|
|
||||||
} else if (binding.toolbar.menu.findItem(R.id.details_menu) == null) {
|
|
||||||
binding.toolbar.inflateMenu(R.menu.menu_wallet)
|
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) {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue