@sabstravtech/obtservices 0.2.2310120830 → 0.2.2310131300

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.
@@ -27610,7 +27610,7 @@
27610
27610
  }
27611
27611
  if (currentBaskets.length > 0) {
27612
27612
  // if currentBaskets items don't have currentBasketID reset currentBasketID ENT-4959
27613
- if (currentBaskets.every(function (basket) { return basket.id !== _this.currentBasketID; })) {
27613
+ if (currentBaskets.every(function (basket) { return basket.id !== _this.currentBasketID; }) && _this.currentBaskets.every(function (basket) { return basket.id !== _this.currentBasketID; })) {
27614
27614
  _this.currentBasketID = currentBaskets[0].id;
27615
27615
  }
27616
27616
  // if currentBasketID exists - don't replace currentBasketID with currentBasketsCopy[0].id (if multiple services, we must have a specific currentBasketID ENT-4661)
@@ -28259,11 +28259,15 @@
28259
28259
  var _this = this;
28260
28260
  return new Promise(function (resolve, reject) {
28261
28261
  obs.pipe(operators.take(1)).subscribe(function (basket) {
28262
- var intBasket = _this.findBasket(basketid);
28263
- // this can be the only place we need to do mi, dont need on add/remove/getall
28264
- var isGetMi = basket.status === BasketStatus.Open && !!basket.basketItems.length;
28265
- intBasket.next(basket, isGetMi);
28266
- resolve();
28262
+ // ENT-7827 added this timeout as we were trying to grab the current baskets sometimes and we were still waiting for an update, tbh i would have rather found which call was causing the delay
28263
+ setTimeout(function () {
28264
+ console.log(_this.currentBaskets, _this.currentBasketID, basketid);
28265
+ var intBasket = _this.findBasket(basketid);
28266
+ // this can be the only place we need to do mi, dont need on add/remove/getall
28267
+ var isGetMi = basket.status === BasketStatus.Open && !!basket.basketItems.length;
28268
+ intBasket.next(basket, isGetMi);
28269
+ resolve();
28270
+ }, 100);
28267
28271
  }, function (error) {
28268
28272
  console.error(error);
28269
28273
  var intBasket = _this.findBasket(basketid);