diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginOrSignupScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginOrSignupScreen.kt index 358d42c1d..874eb9337 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginOrSignupScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginOrSignupScreen.kt @@ -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 } } diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginScreen.kt index eeef52c43..5fb180f8f 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/LoginScreen.kt @@ -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) } } diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/SignUpScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/SignUpScreen.kt index d92932043..e4b03e6d8 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/SignUpScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedOff/SignUpScreen.kt @@ -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),