Fixed that if fetchBalanceAndTransactions was set to false accounts haven't been returned

This commit is contained in:
dankito 2021-04-17 23:03:22 +02:00
parent ab35c7f49f
commit 9c9ebb9d57
2 changed files with 6 additions and 1 deletions

View File

@ -111,7 +111,8 @@ open class FinTsClient(
addAccountGetAccountBalancesAndTransactions(bank, getAccountsResponse, callback) addAccountGetAccountBalancesAndTransactions(bank, getAccountsResponse, callback)
} }
else { else {
addAccountDone(bank, getAccountsResponse, mapOf(), callback) val retrievedAccountData = bank.accounts.associateBy( { it }, { RetrievedAccountData.balanceAndTransactionsNotRequestedByUser(it) } )
addAccountDone(bank, getAccountsResponse, retrievedAccountData, callback)
} }
} }
} }

View File

@ -16,6 +16,10 @@ open class RetrievedAccountData(
companion object { companion object {
fun balanceAndTransactionsNotRequestedByUser(account: AccountData): RetrievedAccountData {
return RetrievedAccountData(account, true, null, listOf(), listOf(), null, null)
}
fun unsuccessful(account: AccountData): RetrievedAccountData { fun unsuccessful(account: AccountData): RetrievedAccountData {
return RetrievedAccountData(account, false, null, listOf(), listOf(), null, null) return RetrievedAccountData(account, false, null, listOf(), listOf(), null, null)
} }