Skip to content

Commit

Permalink
Fix condition to check pending plugin (#16)
Browse files Browse the repository at this point in the history
* Fix condition to check pending plugin

* Adjusted width of svg

* PRESS4-90 Send country only if state is skipped

Co-authored-by: Ashritha <[email protected]>
  • Loading branch information
aulisius and Ashritha authored Sep 8, 2022
1 parent f7efb34 commit 24bff42
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/GeneralSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 8 additions & 2 deletions src/components/StoreAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/icons/coming-soon-illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/icons/store-online.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24bff42

Please sign in to comment.