Fixed that 'Could not retrieve transactions' message got displayed even though no account has been added (yet)

This commit is contained in:
dankito 2020-09-22 00:27:34 +02:00
parent be42e3b330
commit f811d25ffd
1 changed files with 2 additions and 1 deletions

View File

@ -257,9 +257,10 @@ class HomeFragment : Fragment() {
private fun setRecyclerViewAndNoTransactionsFetchedView() { private fun setRecyclerViewAndNoTransactionsFetchedView() {
val transactionsRetrievalState = presenter.selectedBankAccountsTransactionRetrievalState val transactionsRetrievalState = presenter.selectedBankAccountsTransactionRetrievalState
val haveTransactionsBeenRetrieved = transactionsRetrievalState == TransactionsRetrievalState.RetrievedTransactions val haveTransactionsBeenRetrieved = transactionsRetrievalState == TransactionsRetrievalState.RetrievedTransactions
val noAccountsAddedYet = presenter.customers.isEmpty()
rcyvwAccountTransactions.visibility = if (haveTransactionsBeenRetrieved) View.VISIBLE else View.GONE rcyvwAccountTransactions.visibility = if (haveTransactionsBeenRetrieved) View.VISIBLE else View.GONE
lytNoTransactionsFetched.visibility = if (haveTransactionsBeenRetrieved) View.GONE else View.VISIBLE lytNoTransactionsFetched.visibility = if (haveTransactionsBeenRetrieved || noAccountsAddedYet) View.GONE else View.VISIBLE
btnRetrieveTransactions.visibility = if (transactionsRetrievalState == TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions) View.GONE else View.VISIBLE btnRetrieveTransactions.visibility = if (transactionsRetrievalState == TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions) View.GONE else View.VISIBLE
val transactionsRetrievalStateMessageId = when (transactionsRetrievalState) { val transactionsRetrievalStateMessageId = when (transactionsRetrievalState) {