fix(t209): stabilize failed login form state

This commit is contained in:
QiuSW
2026-07-27 16:13:18 +08:00
parent 5782c3088d
commit 6d70eee0af
2 changed files with 16 additions and 6 deletions
@@ -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("") }