Skip to content

Commit

Permalink
Fix update order addresses with invertAddress prop
Browse files Browse the repository at this point in the history
  • Loading branch information
acasazza committed Aug 14, 2024
1 parent 21613da commit 0fce80a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export function SaveAddressesButton(props: Props): JSX.Element {
)
customerEmail = Object.keys(isValidEmail).length > 0
}

const shippingAddressCleaned: any = Object.keys(shippingAddress ?? {}).reduce(
(acc, key) => {
return {
Expand Down Expand Up @@ -103,11 +102,13 @@ export function SaveAddressesButton(props: Props): JSX.Element {
shippingAddressId,
lineItems: order?.line_items
})
// NOTE: This is a temporary fix to avoid the button to be disabled when the user is editing an address
const invertAddressesDisable = invertAddresses && shippingAddressId ? false : shippingDisable
const disable =
disabled ||
customerEmail ||
billingDisable ||
shippingDisable ||
invertAddressesDisable ||
countryLockDisable

const handleClick = async (): Promise<void> => {
Expand Down

0 comments on commit 0fce80a

Please sign in to comment.