more
This commit is contained in:
@@ -112,7 +112,7 @@ const SignupPage = () => {
|
||||
|
||||
const handleProceedToPayment = (e) => {
|
||||
e.preventDefault();
|
||||
/*
|
||||
|
||||
if (isBusy) {
|
||||
return;
|
||||
}
|
||||
@@ -120,7 +120,6 @@ const SignupPage = () => {
|
||||
if (dataValues === null) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
setShowPaymentModal(true);
|
||||
};
|
||||
@@ -137,7 +136,29 @@ const SignupPage = () => {
|
||||
if (paymentDataValues === null) {
|
||||
return;
|
||||
}
|
||||
console.log("paymentDataValues", paymentDataValues);
|
||||
const dataValues = validateData();
|
||||
if (dataValues === null) {
|
||||
return;
|
||||
}
|
||||
setIsBusy(true);
|
||||
const paymentSuccess = handleStripeAuthorization(paymentDataValues);
|
||||
if (paymentSuccess) {
|
||||
try {
|
||||
const userCredential = await createUserWithEmailAndPassword(
|
||||
auth,
|
||||
dataValues.email,
|
||||
dataValues.password
|
||||
);
|
||||
const user = userCredential.user;
|
||||
await saveUserData(user.uid, dataValues);
|
||||
navigate("/");
|
||||
} catch (error) {
|
||||
setIsBusy(false);
|
||||
setNotice(
|
||||
error.message || "Sorry, something went wrong. Please try again."
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user