ng-easycommerce 0.0.600 → 0.0.601

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8114,14 +8114,15 @@ var DataFormEcComponent = /** @class */ (function (_super) {
8114
8114
  :
8115
8115
  [];
8116
8116
  _this.provincesSubject.next(provinces);
8117
- _this.checkoutForm.controls['provinceCode'].setValue(provinces[0].code);
8117
+ if (provinces.length) {
8118
+ _this.checkoutForm.controls['provinceCode'].setValue(provinces[0].code);
8119
+ }
8118
8120
  //Document types
8119
- var documentTypes = value && value != 'null' ?
8120
- _this.countriesSubject.value.find(function (country) { return country.code == value; }).documentTypes
8121
- :
8122
- [];
8121
+ var documentTypes = selectedCountry ? selectedCountry.documentTypes : [];
8123
8122
  _this.documentTypesSubject.next(documentTypes);
8124
- _this.checkoutForm.controls['documentType'].setValue(documentTypes[0].code);
8123
+ if (documentTypes.length) {
8124
+ _this.checkoutForm.controls['documentType'].setValue(documentTypes[0].code);
8125
+ }
8125
8126
  var selectedDocumentType = documentTypes.find(function (doc) { return doc.code == _this.checkoutForm.controls['documentType'].value; });
8126
8127
  if (selectedDocumentType) {
8127
8128
  _this.updateDocumentValidation(selectedDocumentType);