Skip to content

Commit

Permalink
Name refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed Jan 30, 2024
1 parent 3ff4db2 commit 6b60b14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fun LoginPage() {
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun LoginPage(
accountViewModel: AccountStateViewModel,
accountStateViewModel: AccountStateViewModel,
isFirstLogin: Boolean,
onWantsToLogin: () -> Unit,
) {
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fun SignUpPage() {

@Composable
fun SignUpPage(
accountViewModel: AccountStateViewModel,
accountStateViewModel: AccountStateViewModel,
onWantsToLogin: () -> Unit,
) {
val displayName = remember { mutableStateOf(TextFieldValue("")) }
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 6b60b14

Please sign in to comment.