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, isFirstLogin: Boolean,
newAccountKey: String?, newAccountKey: String?,
) { ) {
clear()
this.isFirstLogin = isFirstLogin this.isFirstLogin = isFirstLogin
acceptedTerms = isFirstLogin acceptedTerms = !isFirstLogin
if (newAccountKey != null) { if (newAccountKey != null) {
key = TextFieldValue(newAccountKey) 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( fun updateKey(
value: TextFieldValue, value: TextFieldValue,
throughQR: Boolean, throughQR: Boolean,