Fixes screen clean up in Login

This commit is contained in:
Vitor Pamplona
2025-07-18 17:47:56 -04:00
parent 9d9963d324
commit 85dd9dd5a4

View File

@@ -60,13 +60,27 @@ class LoginViewModel : ViewModel() {
isFirstLogin: Boolean,
newAccountKey: String?,
) {
clear()
this.isFirstLogin = isFirstLogin
acceptedTerms = isFirstLogin
acceptedTerms = !isFirstLogin
if (newAccountKey != null) {
key = TextFieldValue(newAccountKey)
}
}
fun clear() {
key = TextFieldValue("")
password = TextFieldValue("")
errorManager.clearErrors()
acceptedTerms = false
processingLogin = false
isTemporary = false
offerTemporaryLogin = false
torSettings = TorSettings()
isFirstLogin = false
}
fun updateKey(
value: TextFieldValue,
throughQR: Boolean,