From b32cf94e25ecb2ced70c023aa9482a8e2266e705 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 8 Sep 2024 20:20:31 +0200 Subject: [PATCH] Using now isEnteringTanDone --- .../net/codinux/banking/fints/FinTsJobExecutor.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt index 0cd7d684..aa27bd42 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt @@ -380,20 +380,19 @@ open class FinTsJobExecutor( protected open suspend fun handleEnteringTanRequired(context: JobContext, tanResponse: TanResponse, response: BankResponse): BankResponse { // on all platforms run on Dispatchers.Main, but on iOS skip this (or wrap in withContext(Dispatchers.IO) ) // val enteredTanResult = GlobalScope.async { - val tanChallenge = createTanChallenge(tanResponse, modelMapper.mapToActionRequiringTan(context.type), context.bank, context.account) + val tanChallenge = createTanChallenge(tanResponse, modelMapper.mapToActionRequiringTan(context.type), context.bank, context.account) - context.callback.enterTan(tanChallenge) + context.callback.enterTan(tanChallenge) - while (tanChallenge.enterTanResult == null) { - delay(250) + while (tanChallenge.isEnteringTanDone == false) { + delay(250) - mayRetrieveAutomaticallyIfUserEnteredDecoupledTan(context, tanChallenge, tanResponse) + mayRetrieveAutomaticallyIfUserEnteredDecoupledTan(context, tanChallenge, tanResponse) - // TODO: add a timeout of e.g. 30 min - } + // TODO: add a timeout of e.g. 30 min + } val enteredTanResult = tanChallenge.enterTanResult!! -// } return handleEnterTanResult(context, enteredTanResult, tanResponse, response) }