Name refactoring

This commit is contained in:
Vitor Pamplona 2024-01-30 13:52:02 -05:00
parent 3ff4db264a
commit 6b60b1434f
3 changed files with 9 additions and 9 deletions

View File

@ -39,11 +39,11 @@ fun LoginOrSignupScreen(
Crossfade(wantsNewUser, label = "LoginOrSignupScreen") {
if (it) {
SignUpPage(accountViewModel = accountViewModel) {
SignUpPage(accountStateViewModel = accountViewModel) {
wantsNewUser = false
}
} else {
LoginPage(accountViewModel = accountViewModel, isFirstLogin = isFirstLogin) {
LoginPage(accountStateViewModel = accountViewModel, isFirstLogin = isFirstLogin) {
wantsNewUser = true
}
}

View File

@ -123,7 +123,7 @@ fun LoginPage() {
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun LoginPage(
accountViewModel: AccountStateViewModel,
accountStateViewModel: AccountStateViewModel,
isFirstLogin: Boolean,
onWantsToLogin: () -> Unit,
) {
@ -209,7 +209,7 @@ fun LoginPage(
}
if (acceptedTerms.value && key.value.text.isNotBlank()) {
accountViewModel.login(
accountStateViewModel.login(
key.value.text,
useProxy.value,
proxyPort.value.toInt(),
@ -331,7 +331,7 @@ fun LoginPage(
}
if (acceptedTerms.value && key.value.text.isNotBlank()) {
accountViewModel.login(key.value.text, useProxy.value, proxyPort.value.toInt()) {
accountStateViewModel.login(key.value.text, useProxy.value, proxyPort.value.toInt()) {
errorMessage = context.getString(R.string.invalid_key)
}
}
@ -444,7 +444,7 @@ fun LoginPage(
}
if (acceptedTerms.value && key.value.text.isNotBlank()) {
accountViewModel.login(key.value.text, useProxy.value, proxyPort.value.toInt()) {
accountStateViewModel.login(key.value.text, useProxy.value, proxyPort.value.toInt()) {
errorMessage = context.getString(R.string.invalid_key)
}
}

View File

@ -94,7 +94,7 @@ fun SignUpPage() {
@Composable
fun SignUpPage(
accountViewModel: AccountStateViewModel,
accountStateViewModel: AccountStateViewModel,
onWantsToLogin: () -> Unit,
) {
val displayName = remember { mutableStateOf(TextFieldValue("")) }
@ -163,7 +163,7 @@ fun SignUpPage(
}
if (acceptedTerms.value && displayName.value.text.isNotBlank()) {
accountViewModel.login(displayName.value.text, useProxy.value, proxyPort.value.toInt()) {
accountStateViewModel.login(displayName.value.text, useProxy.value, proxyPort.value.toInt()) {
errorMessage = context.getString(R.string.invalid_key)
}
}
@ -273,7 +273,7 @@ fun SignUpPage(
}
if (acceptedTerms.value && displayName.value.text.isNotBlank()) {
accountViewModel.newKey(useProxy.value, proxyPort.value.toInt(), displayName.value.text)
accountStateViewModel.newKey(useProxy.value, proxyPort.value.toInt(), displayName.value.text)
}
},
shape = RoundedCornerShape(Size35dp),