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,
|
||||
setUseShippingAsBilling: __internalSetUseShippingAsBilling,
|
||||
showShippingFields: ! forcedBillingAddress && needsShipping,
|
||||
showBillingFields:
|
||||
forcedBillingAddress || ! needsShipping || ! useShippingAsBilling,
|
||||
showBillingFields: ! needsShipping || ! useShippingAsBilling,
|
||||
forcedBillingAddress,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -38,9 +38,9 @@ const FrontendBlock = ( {
|
|||
showCompanyField,
|
||||
showPhoneField,
|
||||
} = useCheckoutBlockContext();
|
||||
const { showBillingFields } = useCheckoutAddress();
|
||||
const { showBillingFields, forcedBillingAddress } = useCheckoutAddress();
|
||||
|
||||
if ( ! showBillingFields ) {
|
||||
if ( ! showBillingFields && ! forcedBillingAddress ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue