updating launcher text

This commit is contained in:
dante ruiz 2019-10-22 14:24:32 -07:00
parent cb970a7499
commit bfa89452e0
4 changed files with 20 additions and 13 deletions

View file

@ -42,7 +42,7 @@ Item {
HFTextHeader {
id: firstText
text: "Set up will take a moment"
text: "Setup will take a moment"
anchors {
top: logo.bottom

View file

@ -164,7 +164,11 @@ Item {
topMargin: 4
}
onAccepted: LauncherState.signup(email.text, username.text, password.text, displayName.text)
onAccepted: {
if (root.enabled && email.text.length > 0 && username.text.length > 0 && password.text.length > 0 && displayName.text.length > 0) {
LauncherState.signup(email.text, username.text, password.text, displayName.text);
}
}
}
HFButton {

View file

@ -137,7 +137,11 @@ Item {
left: parent.left
right: parent.right;
}
onAccepted: LauncherState.login(username.text, password.text, displayName.text)
onAccepted: {
if (root.enabled && username.text.length > 0 && password.text.length > 0 && displayName.text.length > 0) {
LauncherState.login(username.text, password.text, displayName.text);
}
}
}
HFButton {

View file

@ -286,7 +286,6 @@ void LauncherState::getCurrentClientVersion() {
setApplicationState(ApplicationState::WaitingForLogin);
}
}
//setApplicationState(ApplicationState::WaitingForLogin);
}
@ -335,19 +334,19 @@ void LauncherState::signup(QString email, QString username, QString password, QS
auto err = signupRequest->getError();
if (err == SignupRequest::Error::ExistingUsername) {
setLastSignupErrorMessage(_username + " is already taken - please try a different username.");
setLastSignupErrorMessage(_username + " is already taken. Please try a different username.");
setApplicationState(ApplicationState::WaitingForSignup);
return;
} else if (err == SignupRequest::Error::BadPassword) {
setLastSignupErrorMessage("That's an invalid password - must be at least 6 characters.");
setLastSignupErrorMessage("That's an invalid password. Must be at least 6 characters.");
setApplicationState(ApplicationState::WaitingForSignup);
return;
} else if (err == SignupRequest::Error::BadUsername) {
setLastSignupErrorMessage("That's an invalid username - please try another username.");
setLastSignupErrorMessage("That's an invalid username. Please try another username.");
setApplicationState(ApplicationState::WaitingForSignup);
return;
} else if (err == SignupRequest::Error::UserProfileAlreadyCompleted) {
setLastSignupErrorMessage("This email exists, if it's yours please <b><a href='login'>login</a></b>.");
setLastSignupErrorMessage("An account with this email already exists. Please <b><a href='login'>log in</a></b>.");
setApplicationState(ApplicationState::WaitingForSignup);
return;
} else if (err == SignupRequest::Error::NoSuchEmail) {
@ -355,7 +354,7 @@ void LauncherState::signup(QString email, QString username, QString password, QS
setApplicationState(ApplicationState::WaitingForSignup);
return;
} else if (err != SignupRequest::Error::None) {
setApplicationStateError("Failed to sign up");
setApplicationStateError("Failed to sign up. Please try again.");
return;
}
@ -374,11 +373,11 @@ void LauncherState::signup(QString email, QString username, QString password, QS
auto err = loginRequest->getError();
if (err == LoginRequest::Error::BadUsernameOrPassword) {
setLastLoginErrorMessage("Bad username or password");
setLastLoginErrorMessage("Invalid username or password.");
setApplicationState(ApplicationState::WaitingForLogin);
return;
} else if (err != LoginRequest::Error::None) {
setApplicationStateError("Failed to login");
setApplicationStateError("Failed to login. Please try again.");
return;
}
@ -413,11 +412,11 @@ void LauncherState::login(QString username, QString password, QString displayNam
auto err = request->getError();
if (err == LoginRequest::Error::BadUsernameOrPassword) {
setLastLoginErrorMessage("Bad username or password");
setLastLoginErrorMessage("Invalid username or password");
setApplicationState(ApplicationState::WaitingForLogin);
return;
} else if (err != LoginRequest::Error::None) {
setApplicationStateError("Failed to login");
setApplicationStateError("Failed to login. Please try again.");
return;
}