ng-easycommerce 0.0.640 → 0.0.642

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,7 @@
1
+ # version 0.0.642
2
+ - `sidebar` evitar spam al actualizar cantidades de items del pedido
3
+ # version 0.0.641
4
+ - evitar spam al actualizar cantidades de items del pedido.
1
5
  # version 0.0.640
2
6
  - `place-to-pay`: agregar manejo de pago rechazado
3
7
  - `product-detail.service`: se toma el saleprice de `taxLegendInfo`
@@ -4927,7 +4927,11 @@
4927
4927
  };
4928
4928
  this.updateItemQuantity = function (item, quantity) {
4929
4929
  if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
4930
- _this.connection.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) }).subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
4930
+ _this.requestInProcess.next(true);
4931
+ _this.connection
4932
+ .put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
4933
+ .pipe(operators.finalize(function () { return _this.requestInProcess.next(false); }))
4934
+ .subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
4931
4935
  }
4932
4936
  };
4933
4937
  this.validateQuantity = function (item, quantity) {
@@ -7483,6 +7487,7 @@
7483
7487
  _this.hideTaxes = false;
7484
7488
  _this.creditAccountShowPrices = null;
7485
7489
  _this.showTaxLegend = false;
7490
+ _this.cartLoading = false;
7486
7491
  _this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
7487
7492
  _this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
7488
7493
  _this.getVariants = function (product) {
@@ -7558,11 +7563,17 @@
7558
7563
  this.cartService.showPrice$.subscribe(function (showPrice) {
7559
7564
  _this.creditAccountShowPrices = showPrice;
7560
7565
  });
7566
+ this.cartService.loading.subscribe(function (isLoading) {
7567
+ _this.cartLoading = isLoading;
7568
+ });
7561
7569
  this.ecOnInit();
7562
7570
  };
7563
7571
  CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
7564
7572
  var _this = this;
7565
7573
  var _a;
7574
+ if (this.cartLoading) {
7575
+ return;
7576
+ }
7566
7577
  var multipleQuantity = ((_a = item.product) === null || _a === void 0 ? void 0 : _a.variants) && item.product.variants.length > 0 ? item.product.variants[0].multipleQuantity : 0;
7567
7578
  var step = multipleQuantity && multipleQuantity > 0 ? multipleQuantity : 1;
7568
7579
  var newQuantity;
@@ -19126,6 +19137,7 @@
19126
19137
  this.hideTaxes = false;
19127
19138
  this.creditAccountShowPrices = null;
19128
19139
  this.showTaxLegend = false;
19140
+ this.cartLoading = false;
19129
19141
  this.getVariants = function (product) {
19130
19142
  var item = product.product;
19131
19143
  if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
@@ -19183,9 +19195,15 @@
19183
19195
  this.cartService.showPrice$.subscribe(function (showPrice) {
19184
19196
  _this.creditAccountShowPrices = showPrice;
19185
19197
  });
19198
+ this.cartService.loading.subscribe(function (isLoading) {
19199
+ _this.cartLoading = isLoading;
19200
+ });
19186
19201
  };
19187
19202
  SidebarEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
19188
19203
  var _a;
19204
+ if (this.cartLoading) {
19205
+ return;
19206
+ }
19189
19207
  var multipleQuantity = ((_a = item.product) === null || _a === void 0 ? void 0 : _a.variants) && item.product.variants.length > 0 ? item.product.variants[0].multipleQuantity : 0;
19190
19208
  var step = multipleQuantity && multipleQuantity > 0 ? multipleQuantity : 1;
19191
19209
  var newQuantity;