In spartacus proceed to check out scenario navigating to delivery mode does not happen in a single click. In the second click, only navigation is happening am trying to avoid the second click even I did not though get any error in the console. am using the validating address for third-party API.
Below is my code:
onSubmit(): void {
this.sub.add(
this.authService
.isUserLoggedIn()
.pipe(take(1))
.subscribe(async (isUserLoggedIn: boolean) => {
if (this.addressForm.valid && !isUserLoggedIn && this.showEmailControl) {
const email = this.email$.getValue();
if (this.initialEmail$.getValue() === undefined) {
this.activeCartService.addEmail(email);
} else {
this.addressForm.valueChanges.subscribe((value) => {
this.changeEmail(email);
});
}
}
})
);
this.verifyAddressValidation();
this.changeDetection.detectChanges();
}
async verifyAddressValidation(): Promise<void> {
if (this.addressForm.valid) {
try {
// Verify address through locate for address that are not multi-country (i.e shipping)
if (!this.showCountrySelector) {
const Confirmed = await this.loqateService.verifyAddress(this.addressForm, this.extendFormAttributes);
if (!Confirmed) {
return;
}
}
this.checkoutDeliveryService.verifyAddress(this.addressForm.value);
} finally {.
}
} else {
this.addressForm.markAllAsTouched();
}
}
For the first click there nothing is happening and on the second click, it navigates to the delivery mode page. Please help me to fix this issue and also find the attached screenshot
