Fixed return getBankInfoResponse including its error

This commit is contained in:
dankito 2021-11-01 15:53:47 +01:00
parent bd2c96bbcb
commit fed10e21c0
1 changed files with 4 additions and 5 deletions

View File

@ -629,13 +629,12 @@ open class FinTsJobExecutor(
protected open fun ensureBasicBankDataRetrieved(bank: BankData, callback: (BankResponse) -> Unit) {
if (bank.tanMethodSupportedByBank.isEmpty() || bank.supportedJobs.isEmpty()) {
retrieveBasicDataLikeUsersTanMethods(bank) { getBankInfoResponse ->
if (getBankInfoResponse.successful == false || bank.tanMethodSupportedByBank.isEmpty()
|| bank.supportedJobs.isEmpty()) {
if (getBankInfoResponse.successful == false) {
callback(getBankInfoResponse)
} else if (bank.tanMethodSupportedByBank.isEmpty() || bank.supportedJobs.isEmpty()) {
callback(BankResponse(false, errorMessage =
"Could not retrieve basic bank data like supported tan methods or supported jobs")) // TODO: translate // TODO: add as messageToShowToUser
}
else {
} else {
callback(BankResponse(true))
}
}