Updated on 2026-08-14

This commit is contained in:
Tangem 2020-12-18 21:10:43 +03:00
parent ebcaa7bf72
commit f88f21668a
2 changed files with 6 additions and 3 deletions

View file

@ -19,8 +19,11 @@ class CreateTwinWalletMiddleware {
when (action) {
is DetailsAction.CreateTwinWalletAction.ShowWarning -> {
val wallet = store.state.detailsState.wallet
val notEmpty = wallet?.recentTransactions?.isNullOrEmpty() != true ||
wallet.amounts.toSendableAmounts().isNotEmpty()
if (wallet == null) {
store.dispatch(NavigationAction.NavigateTo(AppScreen.CreateTwinWalletWarning))
return
}
val notEmpty = wallet.recentTransactions.isNotEmpty() || wallet.amounts.toSendableAmounts().isNotEmpty()
if (notEmpty) {
store.dispatch(DetailsAction.CreateTwinWalletAction.NotEmpty)
} else {