@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.
@@ -24895,7 +24895,7 @@ class BaseEnterpriseBasketService {
24895
24895
  }
24896
24896
  if (currentBaskets.length > 0) {
24897
24897
  // if currentBaskets items don't have currentBasketID reset currentBasketID ENT-4959
24898
- if (currentBaskets.every(basket => basket.id !== this.currentBasketID)) {
24898
+ if (currentBaskets.every(basket => basket.id !== this.currentBasketID) && this.currentBaskets.every(basket => basket.id !== this.currentBasketID)) {
24899
24899
  this.currentBasketID = currentBaskets[0].id;
24900
24900
  }
24901
24901
  // if currentBasketID exists - don't replace currentBasketID with currentBasketsCopy[0].id (if multiple services, we must have a specific currentBasketID ENT-4661)
@@ -25446,11 +25446,15 @@ class BaseEnterpriseBasketService {
25446
25446
  updateBasket(basketid, obs) {
25447
25447
  return new Promise((resolve, reject) => {
25448
25448
  obs.pipe(take(1)).subscribe((basket) => {
25449
- const intBasket = this.findBasket(basketid);
25450
- // this can be the only place we need to do mi, dont need on add/remove/getall
25451
- const isGetMi = basket.status === BasketStatus.Open && !!basket.basketItems.length;
25452
- intBasket.next(basket, isGetMi);
25453
- resolve();
25449
+ // 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
25450
+ setTimeout(() => {
25451
+ console.log(this.currentBaskets, this.currentBasketID, basketid);
25452
+ const intBasket = this.findBasket(basketid);
25453
+ // this can be the only place we need to do mi, dont need on add/remove/getall
25454
+ const isGetMi = basket.status === BasketStatus.Open && !!basket.basketItems.length;
25455
+ intBasket.next(basket, isGetMi);
25456
+ resolve();
25457
+ }, 100);
25454
25458
  }, (error) => {
25455
25459
  console.error(error);
25456
25460
  const intBasket = this.findBasket(basketid);