ng-easycommerce 0.0.593 → 0.0.594

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.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ # version 0.0.594
2
+ - Se modifica el servicio para obtener la ip.
1
3
  # version 0.0.593
2
4
  - Se obtienen los parametros en el bloque de newsletter.
3
5
  # version 0.0.592
@@ -3346,7 +3346,7 @@
3346
3346
  function IpService(http) {
3347
3347
  this.http = http;
3348
3348
  this.apiGetIp = 'https://api64.ipify.org?format=json'; // También puedes usar 'https://api.myip.com'
3349
- this.apiGetLocation = 'http://ip-api.com/json/';
3349
+ this.apiGetLocation = 'https://ipinfo.io/json';
3350
3350
  }
3351
3351
  IpService.prototype.getIp = function () {
3352
3352
  return this.http.get(this.apiGetIp);
@@ -3481,18 +3481,16 @@
3481
3481
  _this.stateSubject.next(final_steps);
3482
3482
  // Obtener IP y ubicación
3483
3483
  rxjs.forkJoin({
3484
- ip: _this.ipService.getIp(),
3485
- location: _this.ipService.getLocation()
3484
+ ip: _this.ipService.getIp().pipe(operators.catchError(function () { return rxjs.of(null); })),
3485
+ location: _this.ipService.getLocation().pipe(operators.catchError(function () { return rxjs.of(null); }))
3486
3486
  }).subscribe(function (results) {
3487
3487
  var _a, _b, _c;
3488
3488
  var params = {
3489
- ip: (_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip,
3490
- country: (_b = results.location) === null || _b === void 0 ? void 0 : _b.country,
3491
- city: (_c = results.location) === null || _c === void 0 ? void 0 : _c.city
3489
+ ip: ((_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip) || 'unknown',
3490
+ country: ((_b = results.location) === null || _b === void 0 ? void 0 : _b.country) || 'unknown',
3491
+ city: ((_c = results.location) === null || _c === void 0 ? void 0 : _c.city) || 'unknown'
3492
3492
  };
3493
- // Convertir los datos a una cadena de consulta
3494
3493
  var queryString = new URLSearchParams(params).toString();
3495
- // Agregar la cadena de consulta a la URL del endpoint
3496
3494
  var urlWithParams = _this.getHasPurchaseConditions() + "?" + queryString;
3497
3495
  _this.connection.getErrorNotHandler(urlWithParams).toPromise().then(function (res) {
3498
3496
  var _a, _b;