simpo-component-library 1.8.999 → 1.8.9991

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,7 +112,11 @@ export class StorageServiceService {
112
112
  userCartResponse.onsuccess = (userCartIndexDB) => {
113
113
  userCart.orderedItems = [...(userCartIndexDB.target.result ?? []), ...(userCart?.orderedItems ?? [])];
114
114
  this.addAllProductsToCart(userCart.orderedItems);
115
- this.restService.addItemToDB(userCart);
115
+ this.restService.addItemToDB(userCart).subscribe((res) => {
116
+ if (res?.data?.cartId && !localStorage.getItem('cartId'))
117
+ localStorage.setItem('cartId', res.data.cartId);
118
+ this.clearUserCart();
119
+ });
116
120
  };
117
121
  });
118
122
  const userWishlist = cartResponse?.[1].data;
@@ -227,4 +231,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
227
231
  providedIn: 'root'
228
232
  }]
229
233
  }], ctorParameters: () => [{ type: i1.EventsService }, { type: i2.CookieService }, { type: i3.RestService }] });
230
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2ltcG8tdWkvc3JjL2xpYi9zZXJ2aWNlcy9zdG9yYWdlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBVSxNQUFNLGVBQWUsQ0FBQztBQUtuRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRWhDLE9BQU8sRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0NBQWtDLENBQUM7Ozs7O0FBS2xFLE1BQU0sT0FBTyxxQkFBcUI7SUFFaEMsWUFDbUIsWUFBMkIsRUFDM0IsYUFBNEIsRUFDNUIsV0FBd0I7UUFGeEIsaUJBQVksR0FBWixZQ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xyXG4gIC8vICAgfSk7XHJcbiAgLy8gfVxyXG59XHJcbiJdfQ==
@@ -3706,7 +3706,11 @@ class StorageServiceService {
3706
3706
  userCartResponse.onsuccess = (userCartIndexDB) => {
3707
3707
  userCart.orderedItems = [...(userCartIndexDB.target.result ?? []), ...(userCart?.orderedItems ?? [])];
3708
3708
  this.addAllProductsToCart(userCart.orderedItems);
3709
- this.restService.addItemToDB(userCart);
3709
+ this.restService.addItemToDB(userCart).subscribe((res) => {
3710
+ if (res?.data?.cartId && !localStorage.getItem('cartId'))
3711
+ localStorage.setItem('cartId', res.data.cartId);
3712
+ this.clearUserCart();
3713
+ });
3710
3714
  };
3711
3715
  });
3712
3716
  const userWishlist = cartResponse?.[1].data;