diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt index 65060be..c37a3cf 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt @@ -38,7 +38,7 @@ class BankingService( ) { private val client = FinTs4kBankingClient(FinTsClientConfiguration(FinTsClientOptions(true)), SimpleBankingClientCallback { tanChallenge, callback -> - uiState.tanChallengeReceived.value = TanChallengeReceived(tanChallenge, callback) + uiState.receivedTanChallenge(tanChallenge, callback) }) private val modelService = BankingModelService() diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/state/UiState.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/state/UiState.kt index ec1e93d..848bb9d 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/state/UiState.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/state/UiState.kt @@ -5,6 +5,8 @@ import androidx.compose.material.DrawerValue import androidx.lifecycle.ViewModel import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow +import net.codinux.banking.client.model.tan.EnterTanResult +import net.codinux.banking.client.model.tan.TanChallenge import net.codinux.banking.dataaccess.entities.UserEntity import net.codinux.banking.ui.model.* import net.codinux.banking.ui.model.error.ApplicationError @@ -50,6 +52,10 @@ class UiState : ViewModel() { val tanChallengeReceived = MutableStateFlow(null) + fun receivedTanChallenge(tanChallenge: TanChallenge, callback: (EnterTanResult) -> Unit) { + tanChallengeReceived.value = TanChallengeReceived(tanChallenge, callback) + } + val bankingClientErrorOccurred = MutableStateFlow(null) val applicationErrorOccurred = MutableStateFlow(null)