ng-miam 4.6.13 → 4.6.15

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.
@@ -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) { return _this.pos$.next(pos); })).subscribe();
1164
+ this.get(posId, { include: ['supplier'] }).pipe(operators.skipWhile(function (pos) { return pos.is_loading; }), operators.tap(function (pos) {
1165
+ _this.posHasBeenFetched = true;
1166
+ _this.pos$.next(pos);
1167
+ })).subscribe();
1164
1168
  }
1165
1169
  return this.pos$;
1166
1170
  };
@@ -1177,9 +1181,8 @@
1177
1181
  include: ['supplier']
1178
1182
  }).pipe(operators.skipWhile(function (pos) { return pos.is_loading; }), operators.tap(function (pos) {
1179
1183
  // TODO when data empty => hide webc
1180
- if (pos.data.length > 0) {
1181
- _this.pos$.next(pos.data[0]);
1182
- }
1184
+ _this.posHasBeenFetched = true;
1185
+ _this.pos$.next(pos.data[0]);
1183
1186
  })).subscribe();
1184
1187
  return this.pos$;
1185
1188
  };
@@ -10593,13 +10596,18 @@
10593
10596
  }),
10594
10597
  this.blockStates.subscribe(function (newState) { return _this.handelblockState(newState); }),
10595
10598
  this.listsService.takeFirstList().pipe(operators.switchMap(function (list) {
10596
- return _this.basketsService.basketPreview$.pipe(operators.skipWhile(function (preview) { return !preview || preview.length === 0 || preview.length !== list.recipeInfos.length; }), operators.tap(function (preview) { return _this.refreshPreview(preview.reverse()); }));
10599
+ return _this.basketsService.basketPreview$.pipe(
10600
+ // skipWhile(preview => !preview || preview.length === 0 || preview.length !== list.recipeInfos.length),
10601
+ operators.skipWhile(function (preview) { return !preview || preview.length !== list.recipeInfos.length; }), operators.tap(function (preview) { return _this.refreshPreview(preview.reverse()); }));
10597
10602
  })).subscribe(function () {
10598
10603
  _this.loading.next(false);
10599
10604
  _this.cdr.detectChanges();
10600
10605
  }),
10601
10606
  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 () {
10607
+ this.posService.isPosValid().subscribe(function (isValid) {
10608
+ if (!isValid && _this.posService.posHasBeenFetched) {
10609
+ _this.loading.next(false);
10610
+ }
10603
10611
  _this.cdr.detectChanges();
10604
10612
  })
10605
10613
  ];