mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-01 09:49:17 +02:00
Name refactoring
This commit is contained in:
parent
3ff4db264a
commit
6b60b1434f
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user