Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kpawelczak committed Jul 5, 2023
1 parent ab71c10 commit cc62a10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export class CheckoutDeliveryAddressComponent implements OnInit {
activeCartFacade: ActiveCartFacade,
checkoutStepService: CheckoutStepService,
checkoutDeliveryModesFacade: CheckoutDeliveryModesFacade,
globalMessageService: GlobalMessageService
globalMessageService: GlobalMessageService,
// eslint-disable-next-line @typescript-eslint/unified-signatures
checkoutConfigService: CheckoutConfigService
);
/**
* @deprecated since 6.2
Expand Down Expand Up @@ -170,7 +172,11 @@ export class CheckoutDeliveryAddressComponent implements OnInit {
}

addAddress(address: Address | undefined): void {
if (!address && this.selectedAddress) {
if (
!address &&
this.shouldUseAddressSavedInCart() &&
this.selectedAddress
) {
this.next();
}

Expand Down Expand Up @@ -279,10 +285,7 @@ export class CheckoutDeliveryAddressComponent implements OnInit {
this.setAddress(selected);
}
this.doneAutoSelect = true;
} else if (
selected &&
this.checkoutConfigService?.shouldUseAddressSavedInCart()
) {
} else if (selected && this.shouldUseAddressSavedInCart()) {
this.selectedAddress = selected;
}
}
Expand Down Expand Up @@ -338,4 +341,8 @@ export class CheckoutDeliveryAddressComponent implements OnInit {
protected onError(): void {
this.busy$.next(false);
}

protected shouldUseAddressSavedInCart(): boolean {
return !!this.checkoutConfigService?.shouldUseAddressSavedInCart();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class CheckoutConfigService {
}

shouldUseAddressSavedInCart(): boolean {
return this.checkoutConfig?.checkout?.guestUseSavedAddress;
return !!this.checkoutConfig?.checkout?.guestUseSavedAddress;
}

getPreferredDeliveryMode(deliveryModes: DeliveryMode[]): string | undefined {
Expand Down

0 comments on commit cc62a10

Please sign in to comment.