forked from React-Group/interstellar_ai
Removed the empty account creation bug
This commit is contained in:
parent
36ebd0d5c5
commit
601b0324b8
1 changed files with 9 additions and 5 deletions
|
@ -79,12 +79,16 @@ const Login: React.FC = () => {
|
||||||
|
|
||||||
// Function to handle account creation
|
// Function to handle account creation
|
||||||
const handleCreateAccount = async () => {
|
const handleCreateAccount = async () => {
|
||||||
const success = await createAccount(newAccountName, newAccountEmail, newAccountPassword);
|
if (newAccountName !== "" && newAccountEmail !== "" && newAccountPassword !== "") {
|
||||||
if (success) {
|
const success = await createAccount(newAccountName, newAccountEmail, newAccountPassword);
|
||||||
alert('Account created successfully! You can now log in.');
|
if (success) {
|
||||||
toggleSignUpPopup(); // Close sign-up popup
|
alert('Account created successfully! You can now log in.');
|
||||||
|
toggleSignUpPopup(); // Close sign-up popup
|
||||||
|
} else {
|
||||||
|
alert('Account creation failed. Please try again.');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
alert('Account creation failed. Please try again.');
|
alert('Account creation failed. Please do not leave any field empty.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue