ng-easycommerce 0.0.636 → 0.0.638
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 +5 -0
- package/bundles/ng-easycommerce.umd.js +4 -0
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/services/cart.service.js +6 -1
- package/esm5/lib/services/cart.service.js +6 -1
- package/fesm2015/ng-easycommerce.js +5 -1
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +5 -1
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -7,7 +7,7 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
|
7
7
|
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
8
8
|
import { ReplaySubject, of, BehaviorSubject, forkJoin, combineLatest, Observable, throwError } from 'rxjs';
|
|
9
9
|
import 'rxjs/add/operator/map';
|
|
10
|
-
import { take, map, catchError, filter, mapTo, skipWhile, concatMap } from 'rxjs/operators';
|
|
10
|
+
import { take, map, catchError, filter, mapTo, finalize, skipWhile, concatMap } from 'rxjs/operators';
|
|
11
11
|
import 'rxjs/add/operator/catch';
|
|
12
12
|
import 'rxjs/add/observable/of';
|
|
13
13
|
import * as moment from 'moment';
|
|
@@ -4828,6 +4828,9 @@ var CartService = /** @class */ (function () {
|
|
|
4828
4828
|
*/
|
|
4829
4829
|
this.addToCart = function (product, quantity, variant_id, comments) {
|
|
4830
4830
|
var _a, _b, _c, _d;
|
|
4831
|
+
if (_this.requestInProcess.getValue()) {
|
|
4832
|
+
return;
|
|
4833
|
+
}
|
|
4831
4834
|
var balance = _this.balanceCustomerSubject.value;
|
|
4832
4835
|
var applyMaxOrders = (_b = (_a = balance) === null || _a === void 0 ? void 0 : _a.applyMaxOrders, (_b !== null && _b !== void 0 ? _b : false));
|
|
4833
4836
|
var maxOrders = (_d = (_c = balance) === null || _c === void 0 ? void 0 : _c.maxOrders, (_d !== null && _d !== void 0 ? _d : Infinity));
|
|
@@ -4851,6 +4854,7 @@ var CartService = /** @class */ (function () {
|
|
|
4851
4854
|
payload.comments = comments;
|
|
4852
4855
|
}
|
|
4853
4856
|
_this.connection.post(_this.addItemApi(), payload)
|
|
4857
|
+
.pipe(finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4854
4858
|
.subscribe(function (res) {
|
|
4855
4859
|
// Manejar la respuesta HTTP exitosa (código 200)
|
|
4856
4860
|
_this.appendToCart(res);
|