Fixed that if bookedTransactions have been retrieved even though if account says it doesn't support retrieving transactions, state RetrievedTransactions is returned anyway so that transactions get displayed

This commit is contained in:
dankito 2020-10-28 15:41:04 +01:00
parent 518f8c848a
commit 5d0f74c5e7
1 changed files with 6 additions and 4 deletions

View File

@ -949,14 +949,16 @@ open class BankingPresenter(
return TransactionsRetrievalState.AccountTypeNotSupported return TransactionsRetrievalState.AccountTypeNotSupported
} }
if (account.supportsRetrievingAccountTransactions == false) { // check first if transactions already have been received and then if retrieving transactions is supported as it already occurred that
return TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions // transactions have been retrieved but account.supportsRetrievingAccountTransactions was set to false (may retrieving transactions is now not supported anymore)
}
if (account.bookedTransactions.isNotEmpty()) { if (account.bookedTransactions.isNotEmpty()) {
return TransactionsRetrievalState.RetrievedTransactions return TransactionsRetrievalState.RetrievedTransactions
} }
if (account.supportsRetrievingAccountTransactions == false) {
return TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions
}
if (account.retrievedTransactionsUpTo != null) { if (account.retrievedTransactionsUpTo != null) {
return TransactionsRetrievalState.NoTransactionsInRetrievedPeriod return TransactionsRetrievalState.NoTransactionsInRetrievedPeriod
} }