ci(release): switch registry login to REGISTRY_TOKEN #3
@@ -39,13 +39,16 @@ class PasswordViewModel @Inject constructor(
|
|||||||
|
|
||||||
fun change() {
|
fun change() {
|
||||||
val s = internal.value
|
val s = internal.value
|
||||||
if (s.isChanging) return
|
val validationError: String? = when {
|
||||||
if (s.current.isEmpty() || s.next.isEmpty()) {
|
s.isChanging -> "" // sentinel: silent no-op
|
||||||
internal.update { it.copy(message = "All fields required.") }
|
s.current.isEmpty() || s.next.isEmpty() -> "All fields required."
|
||||||
return
|
s.next != s.confirm -> "New passwords do not match."
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
if (validationError != null) {
|
||||||
|
if (validationError.isNotEmpty()) {
|
||||||
|
internal.update { it.copy(message = validationError) }
|
||||||
}
|
}
|
||||||
if (s.next != s.confirm) {
|
|
||||||
internal.update { it.copy(message = "New passwords do not match.") }
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
|
|||||||
Reference in New Issue
Block a user