@@ -16,7 +16,8 @@ const AccountPage = () => {
|
||||
const [docsGenerated, setDocsGenerated] = useState(null);
|
||||
const appUserId = group ? group.appUserId : null;
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
|
||||
const subscriptionPlan = group?.subscriptionPlan[0].label;
|
||||
console.log("subscriptionPlan", subscriptionPlan);
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "development"
|
||||
? process.env.REACT_APP_API_DEV
|
||||
@@ -191,7 +192,7 @@ const AccountPage = () => {
|
||||
<div className="account-section">Active Subscriptions</div>
|
||||
<div className="account-card account-subscriptions">
|
||||
<div className="account-subscriptions-title">
|
||||
{group.subscriptionPlan.toUpperCase()}
|
||||
{`${subscriptionPlan?.toUpperCase()} PLAN`}
|
||||
</div>
|
||||
<div className="account-subscriptions-item">
|
||||
<div className="account-subscriptions-item-label"></div>
|
||||
@@ -201,7 +202,7 @@ const AccountPage = () => {
|
||||
<div className="account-subscriptions-item">
|
||||
<div className="account-subscriptions-item-label">Activated:</div>
|
||||
<div className="account-subscriptions-item-value">
|
||||
{currentUserCreatedAt.toLocaleDateString("en-US")}
|
||||
{currentUserCreatedAt?.toLocaleDateString("en-US")}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -217,13 +218,13 @@ const AccountPage = () => {
|
||||
<div className="account-column">
|
||||
<div className="account-card account-card-right-account account-info">
|
||||
<div className="account-info-name">
|
||||
{group.firstName} {group.lastName}
|
||||
{group?.firstName} {group?.lastName}
|
||||
</div>
|
||||
<div>{group.firm}</div>
|
||||
<div>{group?.firm}</div>
|
||||
<div>
|
||||
<a href={`mailto:${group.email}`}>{group.email}</a>
|
||||
<a href={`mailto:${group?.email}`}>{group?.email}</a>
|
||||
</div>
|
||||
<div>{group.telephone}</div>
|
||||
<div>{group?.telephone}</div>
|
||||
</div>
|
||||
</div>
|
||||
{showModal ? (
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user