Extracted receivedTanChallenge()
This commit is contained in:
parent
f440a01531
commit
91ccfc1844
|
@ -38,7 +38,7 @@ class BankingService(
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val client = FinTs4kBankingClient(FinTsClientConfiguration(FinTsClientOptions(true)), SimpleBankingClientCallback { tanChallenge, callback ->
|
private val client = FinTs4kBankingClient(FinTsClientConfiguration(FinTsClientOptions(true)), SimpleBankingClientCallback { tanChallenge, callback ->
|
||||||
uiState.tanChallengeReceived.value = TanChallengeReceived(tanChallenge, callback)
|
uiState.receivedTanChallenge(tanChallenge, callback)
|
||||||
})
|
})
|
||||||
|
|
||||||
private val modelService = BankingModelService()
|
private val modelService = BankingModelService()
|
||||||
|
|
|
@ -5,6 +5,8 @@ import androidx.compose.material.DrawerValue
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
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.dataaccess.entities.UserEntity
|
||||||
import net.codinux.banking.ui.model.*
|
import net.codinux.banking.ui.model.*
|
||||||
import net.codinux.banking.ui.model.error.ApplicationError
|
import net.codinux.banking.ui.model.error.ApplicationError
|
||||||
|
@ -50,6 +52,10 @@ class UiState : ViewModel() {
|
||||||
|
|
||||||
val tanChallengeReceived = MutableStateFlow<TanChallengeReceived?>(null)
|
val tanChallengeReceived = MutableStateFlow<TanChallengeReceived?>(null)
|
||||||
|
|
||||||
|
fun receivedTanChallenge(tanChallenge: TanChallenge, callback: (EnterTanResult) -> Unit) {
|
||||||
|
tanChallengeReceived.value = TanChallengeReceived(tanChallenge, callback)
|
||||||
|
}
|
||||||
|
|
||||||
val bankingClientErrorOccurred = MutableStateFlow<BankingClientError?>(null)
|
val bankingClientErrorOccurred = MutableStateFlow<BankingClientError?>(null)
|
||||||
|
|
||||||
val applicationErrorOccurred = MutableStateFlow<ApplicationError?>(null)
|
val applicationErrorOccurred = MutableStateFlow<ApplicationError?>(null)
|
||||||
|
|
Loading…
Reference in New Issue