From 6fd98c7b915c7cf65fef7a9991af636c0de2bc46 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Tue, 20 Feb 2024 16:08:44 -0600 Subject: [PATCH] more --- src/Components/Account/AccountPage.js | 12 ++++++------ src/Components/SignupPage/SignupPage.js | 21 ++++++++++----------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/Components/Account/AccountPage.js b/src/Components/Account/AccountPage.js index 55a5e0c..05d67fa 100644 --- a/src/Components/Account/AccountPage.js +++ b/src/Components/Account/AccountPage.js @@ -191,7 +191,7 @@ const AccountPage = () => {
Active Subscriptions
- {group.subscriptionPlan.toUpperCase()} + {group?.subscriptionPlan?.toUpperCase()}
@@ -201,7 +201,7 @@ const AccountPage = () => {
Activated:
- {currentUserCreatedAt.toLocaleDateString("en-US")} + {currentUserCreatedAt?.toLocaleDateString("en-US")}
) : null} @@ -217,13 +217,13 @@ const AccountPage = () => {
- {group.firstName} {group.lastName} + {group?.firstName} {group?.lastName}
-
{group.firm}
+
{group?.firm}
-
{group.telephone}
+
{group?.telephone}
{showModal ? ( diff --git a/src/Components/SignupPage/SignupPage.js b/src/Components/SignupPage/SignupPage.js index af873a5..bdcf3ab 100644 --- a/src/Components/SignupPage/SignupPage.js +++ b/src/Components/SignupPage/SignupPage.js @@ -382,28 +382,28 @@ const SignupPage = () => { dataValues ); - const customerId = data.data.customerId; - const subscriptionCreated = data.data.subscriptionCreated; - const subscriptionPeriodStart = data.data.subscriptionPeriodStart; - const subscriptionPeriodEnd = data.data.subscriptionPeriodEnd; - const subscriptionId = data.data.subscriptionId; + const customerId = data?.data?.customerId; + const subscriptionCreated = data?.data?.subscriptionCreated; + const subscriptionPeriodStart = data?.data?.subscriptionPeriodStart; + const subscriptionPeriodEnd = data?.data?.subscriptionPeriodEnd; + const subscriptionId = data?.data?.subscriptionId; - if (data === undefined) { + if (data === undefined || customerId === undefined) { setIsBusy(false); setNotice("Sorry, something went wrong. Please try again."); return; } else { const userCredential = await createUserWithEmailAndPassword( auth, - dataValues.email, - dataValues.password + dataValues?.email, + dataValues?.password ); - const user = userCredential.user; + const user = userCredential?.user; dataValues = { ...dataValues, ...data }; const isPromotionalMebership = false; const res = await saveUserData( - user.uid, + user?.uid, dataValues, customerId, subscriptionCreated, @@ -419,7 +419,6 @@ const SignupPage = () => { } catch (error) { console.log("Error handling request", error, error.message); setIsBusy(false); - setNotice("Sorry, something went wrong. Please try again."); } }