ng-miam 4.6.13 → 4.6.14
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/bundles/ng-miam.umd.js +12 -3
- package/bundles/ng-miam.umd.js.map +1 -1
- package/bundles/ng-miam.umd.min.js +1 -1
- package/bundles/ng-miam.umd.min.js.map +1 -1
- package/esm2015/lib/_services/point-of-sales.service.js +6 -2
- package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +8 -3
- package/fesm2015/ng-miam.js +12 -3
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_services/point-of-sales.service.d.ts +1 -0
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -1154,13 +1154,17 @@
|
|
|
1154
1154
|
_this.resource = PointOfSale;
|
|
1155
1155
|
_this.type = 'point-of-sales';
|
|
1156
1156
|
_this.pos$ = new rxjs.BehaviorSubject(null);
|
|
1157
|
+
_this.posHasBeenFetched = false;
|
|
1157
1158
|
_this.register();
|
|
1158
1159
|
return _this;
|
|
1159
1160
|
}
|
|
1160
1161
|
PointOfSalesService.prototype.loadPos = function (posId) {
|
|
1161
1162
|
var _this = this;
|
|
1162
1163
|
if (!this.pos$.value || this.pos$.value.id !== posId) {
|
|
1163
|
-
this.get(posId, { include: ['supplier'] }).pipe(operators.skipWhile(function (pos) { return pos.is_loading; }), operators.tap(function (pos) {
|
|
1164
|
+
this.get(posId, { include: ['supplier'] }).pipe(operators.skipWhile(function (pos) { return pos.is_loading; }), operators.tap(function (pos) {
|
|
1165
|
+
_this.pos$.next(pos);
|
|
1166
|
+
_this.posHasBeenFetched = true;
|
|
1167
|
+
})).subscribe();
|
|
1164
1168
|
}
|
|
1165
1169
|
return this.pos$;
|
|
1166
1170
|
};
|
|
@@ -10593,13 +10597,18 @@
|
|
|
10593
10597
|
}),
|
|
10594
10598
|
this.blockStates.subscribe(function (newState) { return _this.handelblockState(newState); }),
|
|
10595
10599
|
this.listsService.takeFirstList().pipe(operators.switchMap(function (list) {
|
|
10596
|
-
return _this.basketsService.basketPreview$.pipe(
|
|
10600
|
+
return _this.basketsService.basketPreview$.pipe(
|
|
10601
|
+
// skipWhile(preview => !preview || preview.length === 0 || preview.length !== list.recipeInfos.length),
|
|
10602
|
+
operators.skipWhile(function (preview) { return !preview || preview.length !== list.recipeInfos.length; }), operators.tap(function (preview) { return _this.refreshPreview(preview.reverse()); }));
|
|
10597
10603
|
})).subscribe(function () {
|
|
10598
10604
|
_this.loading.next(false);
|
|
10599
10605
|
_this.cdr.detectChanges();
|
|
10600
10606
|
}),
|
|
10601
10607
|
this.basketsService.basketStats$.pipe(operators.skipWhile(function (stats) { return !stats; }), operators.tap(function (stats) { return _this.statsUpdated.emit(stats); })).subscribe(),
|
|
10602
|
-
this.posService.isPosValid().subscribe(function () {
|
|
10608
|
+
this.posService.isPosValid().subscribe(function (isValid) {
|
|
10609
|
+
if (!isValid && _this.posService.posHasBeenFetched) {
|
|
10610
|
+
_this.loading.next(false);
|
|
10611
|
+
}
|
|
10603
10612
|
_this.cdr.detectChanges();
|
|
10604
10613
|
})
|
|
10605
10614
|
];
|