ng-easycommerce 0.0.640 → 0.0.641

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.
@@ -4941,7 +4941,11 @@ var CartService = /** @class */ (function () {
4941
4941
  };
4942
4942
  this.updateItemQuantity = function (item, quantity) {
4943
4943
  if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
4944
- _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); });
4944
+ _this.requestInProcess.next(true);
4945
+ _this.connection
4946
+ .put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
4947
+ .pipe(finalize(function () { return _this.requestInProcess.next(false); }))
4948
+ .subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
4945
4949
  }
4946
4950
  };
4947
4951
  this.validateQuantity = function (item, quantity) {
@@ -7497,6 +7501,7 @@ var CartEcComponent = /** @class */ (function (_super) {
7497
7501
  _this.hideTaxes = false;
7498
7502
  _this.creditAccountShowPrices = null;
7499
7503
  _this.showTaxLegend = false;
7504
+ _this.cartLoading = false;
7500
7505
  _this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
7501
7506
  _this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
7502
7507
  _this.getVariants = function (product) {
@@ -7572,11 +7577,17 @@ var CartEcComponent = /** @class */ (function (_super) {
7572
7577
  this.cartService.showPrice$.subscribe(function (showPrice) {
7573
7578
  _this.creditAccountShowPrices = showPrice;
7574
7579
  });
7580
+ this.cartService.loading.subscribe(function (isLoading) {
7581
+ _this.cartLoading = isLoading;
7582
+ });
7575
7583
  this.ecOnInit();
7576
7584
  };
7577
7585
  CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
7578
7586
  var _this = this;
7579
7587
  var _a;
7588
+ if (this.cartLoading) {
7589
+ return;
7590
+ }
7580
7591
  var multipleQuantity = ((_a = item.product) === null || _a === void 0 ? void 0 : _a.variants) && item.product.variants.length > 0 ? item.product.variants[0].multipleQuantity : 0;
7581
7592
  var step = multipleQuantity && multipleQuantity > 0 ? multipleQuantity : 1;
7582
7593
  var newQuantity;