fix(t209): stabilize failed login form state
This commit is contained in:
+10
-6
@@ -142,7 +142,7 @@ fun ProcurementScreen(
|
||||
}
|
||||
|
||||
when (state.phase) {
|
||||
ProcurementPhase.SIGNED_OUT -> item {
|
||||
ProcurementPhase.SIGNED_OUT -> item(key = "procurement-login") {
|
||||
LoginSection(
|
||||
state = state,
|
||||
onLogin = onLogin
|
||||
@@ -157,7 +157,9 @@ fun ProcurementScreen(
|
||||
}
|
||||
ProcurementPhase.CLAIMED -> {
|
||||
if (state.authenticationRequired) {
|
||||
item { LoginSection(state = state, onLogin = onLogin) }
|
||||
item(key = "procurement-login") {
|
||||
LoginSection(state = state, onLogin = onLogin)
|
||||
}
|
||||
}
|
||||
item { TaskDetails(state) }
|
||||
item {
|
||||
@@ -196,7 +198,9 @@ fun ProcurementScreen(
|
||||
ProcurementPhase.RUNNING,
|
||||
ProcurementPhase.AUTHORIZATION_EXPIRED -> {
|
||||
if (state.authenticationRequired) {
|
||||
item { LoginSection(state = state, onLogin = onLogin) }
|
||||
item(key = "procurement-login") {
|
||||
LoginSection(state = state, onLogin = onLogin)
|
||||
}
|
||||
}
|
||||
item { TaskDetails(state) }
|
||||
item {
|
||||
@@ -266,14 +270,14 @@ private fun LoginSection(
|
||||
) {
|
||||
val colors = BaoziTheme.colors
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
var backendUrl by remember(state.profile.backendUrl) {
|
||||
var backendUrl by remember {
|
||||
mutableStateOf(state.profile.backendUrl)
|
||||
}
|
||||
var username by remember(state.profile.username) {
|
||||
var username by remember {
|
||||
mutableStateOf(state.profile.username)
|
||||
}
|
||||
var password by remember { mutableStateOf("") }
|
||||
var deviceId by remember(state.profile.deviceId) {
|
||||
var deviceId by remember {
|
||||
mutableStateOf(state.profile.deviceId)
|
||||
}
|
||||
var deviceToken by remember { mutableStateOf("") }
|
||||
|
||||
Reference in New Issue
Block a user