Browse Source

UI: Fixed bug with calling code after first loading

pull/7086/head
Artem Dzhereleiko 4 years ago
parent
commit
8eef3f84bb
  1. 2
      ui-ngx/src/app/shared/components/phone-input.component.ts

2
ui-ngx/src/app/shared/components/phone-input.component.ts

@ -142,7 +142,7 @@ export class PhoneInputComponent implements OnInit, ControlValueAccessor, Valida
this.getFlagAndPhoneNumberData(value);
let phoneNumber = this.phoneFormGroup.get('phoneNumber').value;
if (phoneNumber) {
if (code !== this.countryCallingCode && phoneNumber.includes(code)) {
if (code !== '+' && code !== this.countryCallingCode && phoneNumber.includes(code)) {
phoneNumber = phoneNumber.replace(code, this.countryCallingCode);
this.phoneFormGroup.get('phoneNumber').patchValue(phoneNumber);
}

Loading…
Cancel
Save