From 5d0f74c5e79ffb9b62f07de56b9e29b9845f6cc0 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 28 Oct 2020 15:41:04 +0100 Subject: [PATCH] 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 --- .../dankito/banking/ui/presenter/BankingPresenter.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index d3021d9c..68231bbd 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -949,14 +949,16 @@ open class BankingPresenter( return TransactionsRetrievalState.AccountTypeNotSupported } - if (account.supportsRetrievingAccountTransactions == false) { - return TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions - } - + // check first if transactions already have been received and then if retrieving transactions is supported as it already occurred that + // transactions have been retrieved but account.supportsRetrievingAccountTransactions was set to false (may retrieving transactions is now not supported anymore) if (account.bookedTransactions.isNotEmpty()) { return TransactionsRetrievalState.RetrievedTransactions } + if (account.supportsRetrievingAccountTransactions == false) { + return TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions + } + if (account.retrievedTransactionsUpTo != null) { return TransactionsRetrievalState.NoTransactionsInRetrievedPeriod }