feat: M3 weighted shuffle v1 — real /api/radio with scoring #21
@@ -39,13 +39,16 @@ class PasswordViewModel @Inject constructor(
|
||||
|
||||
fun change() {
|
||||
val s = internal.value
|
||||
if (s.isChanging) return
|
||||
if (s.current.isEmpty() || s.next.isEmpty()) {
|
||||
internal.update { it.copy(message = "All fields required.") }
|
||||
return
|
||||
val validationError: String? = when {
|
||||
s.isChanging -> "" // sentinel: silent no-op
|
||||
s.current.isEmpty() || s.next.isEmpty() -> "All fields required."
|
||||
s.next != s.confirm -> "New passwords do not match."
|
||||
else -> null
|
||||
}
|
||||
if (s.next != s.confirm) {
|
||||
internal.update { it.copy(message = "New passwords do not match.") }
|
||||
if (validationError != null) {
|
||||
if (validationError.isNotEmpty()) {
|
||||
internal.update { it.copy(message = validationError) }
|
||||
}
|
||||
return
|
||||
}
|
||||
viewModelScope.launch {
|
||||
|
||||
Reference in New Issue
Block a user