From b2aac322b187b1d215708188e0d984f18da35d3a Mon Sep 17 00:00:00 2001 From: leonazava Date: Tue, 21 Jun 2022 20:49:24 +0400 Subject: [PATCH 1/2] 4660 - replaced isSignedIn prop which was alway undefined with an util method --- .../CheckoutShipping/CheckoutShipping.component.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js b/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js index 18a039ab1c..917ded5768 100644 --- a/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js +++ b/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js @@ -23,6 +23,7 @@ import { BILLING_STEP, SHIPPING_STEP } from 'Route/Checkout/Checkout.config'; import { Addresstype } from 'Type/Account.type'; import { CheckoutStepType, ShippingMethodsType, ShippingMethodType } from 'Type/Checkout.type'; import { TotalsType } from 'Type/MiniCart.type'; +import { isSignedIn } from 'Util/Auth'; import { getAllCartItemsSku } from 'Util/Cart'; import { formatPrice } from 'Util/Price'; @@ -52,8 +53,7 @@ export class CheckoutShipping extends PureComponent { onEmailChange: PropTypes.func.isRequired, onCreateUserChange: PropTypes.func.isRequired, onPasswordChange: PropTypes.func.isRequired, - isGuestEmailSaved: PropTypes.bool.isRequired, - isSignedIn: PropTypes.bool.isRequired + isGuestEmailSaved: PropTypes.bool.isRequired }; static defaultProps = { @@ -199,12 +199,11 @@ export class CheckoutShipping extends PureComponent { onEmailChange, onCreateUserChange, onPasswordChange, - isGuestEmailSaved, - isSignedIn + isGuestEmailSaved } = this.props; const isBilling = checkoutStep === BILLING_STEP; - if (isSignedIn) { + if (isSignedIn()) { return null; } From 4375a0f90b955b3c9176d547226b6569c5054dab Mon Sep 17 00:00:00 2001 From: leonazava Date: Tue, 21 Jun 2022 20:54:55 +0400 Subject: [PATCH 2/2] again, replaced isSignedIn prop with a util method --- .../component/CheckoutBilling/CheckoutBilling.component.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js index 7922e37dbd..95f307b730 100644 --- a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js +++ b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js @@ -24,6 +24,7 @@ import { BILLING_STEP } from 'Route/Checkout/Checkout.config'; import { Addresstype } from 'Type/Account.type'; import { CheckoutStepType, PaymentMethodsType } from 'Type/Checkout.type'; import { TotalsType } from 'Type/MiniCart.type'; +import { isSignedIn } from 'Util/Auth'; import { formatPrice } from 'Util/Price'; import './CheckoutBilling.style'; @@ -56,7 +57,6 @@ export class CheckoutBilling extends PureComponent { onCreateUserChange: PropTypes.func.isRequired, onPasswordChange: PropTypes.func.isRequired, isGuestEmailSaved: PropTypes.bool.isRequired, - isSignedIn: PropTypes.bool.isRequired, shippingAddress: Addresstype.isRequired, termsAndConditions: PropTypes.arrayOf(PropTypes.shape({ checkbox_text: PropTypes.string @@ -111,12 +111,11 @@ export class CheckoutBilling extends PureComponent { onEmailChange, onCreateUserChange, onPasswordChange, - isGuestEmailSaved, - isSignedIn + isGuestEmailSaved } = this.props; const isBilling = checkoutStep === BILLING_STEP; - if (isSignedIn) { + if (isSignedIn()) { return null; }