From 61d9923230e34da50021ebcf5c5ef8bda640b212 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 1 Sep 2020 14:05:54 +0200 Subject: [PATCH] Implemented resetting selected TAN procedures if user's TAN procedures doesn't contain selected one anymore (should almost never be the case) --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 9ec91252..3df4cb56 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -1100,6 +1100,10 @@ open class FinTsClient( if (response.supportedTanProceduresForUser.isNotEmpty()) { customer.supportedTanProcedures = response.supportedTanProceduresForUser.mapNotNull { findTanProcedure(it, bank) } + + if (customer.supportedTanProcedures.firstOrNull { it.securityFunction == customer.selectedTanProcedure.securityFunction } == null) { // supportedTanProcedures don't contain selectedTanProcedure anymore + customer.resetSelectedTanProcedure() + } } }