Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)
Co-authored-by: Niels Lange <info@nielslange.de>
This commit is contained in:
parent
aa8622d985
commit
9167a04e20
|
@ -90,8 +90,7 @@ export const useCheckoutAddress = (): CheckoutAddress => {
|
||||||
useShippingAsBilling,
|
useShippingAsBilling,
|
||||||
setUseShippingAsBilling: __internalSetUseShippingAsBilling,
|
setUseShippingAsBilling: __internalSetUseShippingAsBilling,
|
||||||
showShippingFields: ! forcedBillingAddress && needsShipping,
|
showShippingFields: ! forcedBillingAddress && needsShipping,
|
||||||
showBillingFields:
|
showBillingFields: ! needsShipping || ! useShippingAsBilling,
|
||||||
forcedBillingAddress || ! needsShipping || ! useShippingAsBilling,
|
|
||||||
forcedBillingAddress,
|
forcedBillingAddress,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,9 +38,9 @@ const FrontendBlock = ( {
|
||||||
showCompanyField,
|
showCompanyField,
|
||||||
showPhoneField,
|
showPhoneField,
|
||||||
} = useCheckoutBlockContext();
|
} = useCheckoutBlockContext();
|
||||||
const { showBillingFields } = useCheckoutAddress();
|
const { showBillingFields, forcedBillingAddress } = useCheckoutAddress();
|
||||||
|
|
||||||
if ( ! showBillingFields ) {
|
if ( ! showBillingFields && ! forcedBillingAddress ) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue