Changed order
This commit is contained in:
parent
7d3a30ca7f
commit
5832a877c0
|
@ -1,8 +1,6 @@
|
|||
package net.codinux.banking.ui.composables
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.*
|
||||
import net.codinux.banking.ui.dialogs.ApplicationErrorDialog
|
||||
import net.codinux.banking.ui.dialogs.BankingClientErrorDialog
|
||||
import net.codinux.banking.ui.dialogs.EnterTanDialog
|
||||
|
@ -10,13 +8,13 @@ import net.codinux.banking.ui.state.UiState
|
|||
|
||||
@Composable
|
||||
fun StateHandler(uiState: UiState) {
|
||||
val applicationError by uiState.applicationErrorOccurred.collectAsState()
|
||||
val bankingClientError by uiState.bankingClientErrorOccurred.collectAsState()
|
||||
val tanChallengeReceived by uiState.tanChallengeReceived.collectAsState()
|
||||
val bankingClientError by uiState.bankingClientErrorOccurred.collectAsState()
|
||||
val applicationError by uiState.applicationErrorOccurred.collectAsState()
|
||||
|
||||
applicationError?.let { error ->
|
||||
ApplicationErrorDialog(error) {
|
||||
uiState.applicationErrorOccurred.value = null
|
||||
tanChallengeReceived?.let { tanChallengeReceived ->
|
||||
EnterTanDialog(tanChallengeReceived) {
|
||||
uiState.tanChallengeReceived.value = null
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,9 +24,9 @@ fun StateHandler(uiState: UiState) {
|
|||
}
|
||||
}
|
||||
|
||||
tanChallengeReceived?.let { tanChallengeReceived ->
|
||||
EnterTanDialog(tanChallengeReceived) {
|
||||
uiState.tanChallengeReceived.value = null
|
||||
applicationError?.let { error ->
|
||||
ApplicationErrorDialog(error) {
|
||||
uiState.applicationErrorOccurred.value = null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ class UiState : ViewModel() {
|
|||
val accountFilter = MutableStateFlow<List<BankAccountFilter>>(emptyList())
|
||||
|
||||
|
||||
val applicationErrorOccurred = MutableStateFlow<ApplicationError?>(null)
|
||||
val tanChallengeReceived = MutableStateFlow<TanChallengeReceived?>(null)
|
||||
|
||||
val bankingClientErrorOccurred = MutableStateFlow<BankingClientError?>(null)
|
||||
|
||||
val tanChallengeReceived = MutableStateFlow<TanChallengeReceived?>(null)
|
||||
val applicationErrorOccurred = MutableStateFlow<ApplicationError?>(null)
|
||||
|
||||
|
||||
fun applicationErrorOccurred(erroneousAction: ErroneousAction, exception: Throwable, errorMessage: String? = null) {
|
||||
|
|
Loading…
Reference in New Issue