Removed the empty account creation bug

This commit is contained in:
sageTheDM 2024-10-08 07:22:09 +02:00
parent 36ebd0d5c5
commit 601b0324b8

View file

@ -79,6 +79,7 @@ const Login: React.FC = () => {
// Function to handle account creation
const handleCreateAccount = async () => {
if (newAccountName !== "" && newAccountEmail !== "" && newAccountPassword !== "") {
const success = await createAccount(newAccountName, newAccountEmail, newAccountPassword);
if (success) {
alert('Account created successfully! You can now log in.');
@ -86,6 +87,9 @@ const Login: React.FC = () => {
} else {
alert('Account creation failed. Please try again.');
}
} else {
alert('Account creation failed. Please do not leave any field empty.');
}
};
// Function to toggle the settings popup