From 24bff42028aa2b07df239253075ced74d36e062c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=8BFaizaan?= Date: Thu, 8 Sep 2022 22:59:05 +0530 Subject: [PATCH] Fix condition to check pending plugin (#16) * Fix condition to check pending plugin * Adjusted width of svg * PRESS4-90 Send country only if state is skipped Co-authored-by: Ashritha --- src/components/GeneralSettings.js | 4 ++-- src/components/StoreAddress.js | 10 ++++++++-- src/icons/coming-soon-illustration.svg | 2 +- src/icons/store-online.svg | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/GeneralSettings.js b/src/components/GeneralSettings.js index 292ae887..c698909d 100644 --- a/src/components/GeneralSettings.js +++ b/src/components/GeneralSettings.js @@ -84,9 +84,9 @@ function useOnBoardingStatus() { function isSelectedThirdPartyPending(key, plugins) { switch (key) { case YithOptions.paypal: - return plugins?.status?.yith_paypal_payments === "Active"; + return plugins?.status?.yith_paypal_payments !== "Active"; case YithOptions.shippo: - return plugins?.status?.yith_shippo_shipping_for_woocommerce === "Active"; + return plugins?.status?.yith_shippo_shipping_for_woocommerce !== "Active"; default: return false; } diff --git a/src/components/StoreAddress.js b/src/components/StoreAddress.js index e9d639ef..04407c28 100644 --- a/src/components/StoreAddress.js +++ b/src/components/StoreAddress.js @@ -38,11 +38,17 @@ export function StoreAddress({ onComplete, isMandatory = false }) { onSubmit={async (event) => { event.preventDefault(); event.stopPropagation(); - let { country, state = defaultContact.state, ...wcAddress } = address; + let { country, state, ...wcAddress } = address; + let selectedState; + if (selectedCountry === defaultContact.country && state === undefined) { + selectedState = defaultContact.state; + } await updateWPSettings({ ...defaultContact, ...wcAddress, - woocommerce_default_country: `${selectedCountry}:${state}`, + woocommerce_default_country: selectedState + ? `${selectedCountry}:${selectedState}` + : selectedCountry, }); await updateWCOnboarding({ completed: true }); await onComplete(); diff --git a/src/icons/coming-soon-illustration.svg b/src/icons/coming-soon-illustration.svg index 9764d137..224df709 100644 --- a/src/icons/coming-soon-illustration.svg +++ b/src/icons/coming-soon-illustration.svg @@ -1,4 +1,4 @@ - + diff --git a/src/icons/store-online.svg b/src/icons/store-online.svg index 486965c2..716c32b3 100644 --- a/src/icons/store-online.svg +++ b/src/icons/store-online.svg @@ -1,4 +1,4 @@ - +