simpo-component-library 2.0.22 → 2.0.24
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/lib/ecommerce/sections/authentication-required/authentication-required.component.mjs +4 -4
- package/esm2022/lib/ecommerce/sections/cart/cart.component.mjs +60 -6
- package/esm2022/lib/services/storage.service.mjs +3 -2
- package/fesm2022/simpo-component-library.mjs +64 -9
- package/fesm2022/simpo-component-library.mjs.map +1 -1
- package/lib/ecommerce/sections/cart/cart.component.d.ts +3 -0
- package/package.json +1 -1
- package/simpo-component-library-2.0.24.tgz +0 -0
- package/simpo-component-library-2.0.22.tgz +0 -0
@@ -169,7 +169,8 @@ export class StorageServiceService {
|
|
169
169
|
if (userDetails?.userId) {
|
170
170
|
try {
|
171
171
|
const response = await this.restService.getUserItems(userDetails?.userId, "CART").toPromise();
|
172
|
-
|
172
|
+
if (response.data?.[0]?.cartId)
|
173
|
+
localStorage.setItem('cartId', response.data?.[0]?.cartId);
|
173
174
|
const serverDBProduct = response?.data?.[0]?.orderedItems ?? [];
|
174
175
|
for (let localProduct of indexDBProduct) {
|
175
176
|
let productFound = false;
|
@@ -293,4 +294,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
|
|
293
294
|
providedIn: 'root'
|
294
295
|
}]
|
295
296
|
}], ctorParameters: () => [{ type: i1.EventsService }, { type: i2.CookieService }, { type: i3.RestService }, { type: i4.Router }] });
|
296
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2ltcG8tdWkvc3JjL2xpYi9zZXJ2aWNlcy9zdG9yYWdlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBVSxNQUFNLGVBQWUsQ0FBQztBQUtuRCxPQ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iAgICAgICAgICAgICAgICBpZiAoIXByb2R1Y3RGb3VuZCkge1xyXG4gICAgICAgICAgICAgICAgICBzZXJ2ZXJEQlByb2R1Y3QucHVzaChsb2NhbFByb2R1Y3QpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB0aGlzLnRvdGFsQ2FydEl0ZW1zID0gc2VydmVyREJQcm9kdWN0Py5sZW5ndGggfHwgMDtcclxuICAgICAgICAgICAgICByZXNvbHZlKHNlcnZlckRCUHJvZHVjdCk7XHJcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihcIkVycm9yIGluIEFQSSBjYWxsOlwiLCBlcnJvcik7XHJcbiAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgdGhpcy50b3RhbENhcnRJdGVtcyA9IGluZGV4REJQcm9kdWN0Py5sZW5ndGggfHwgMDtcclxuICAgICAgICAgICAgcmVzb2x2ZShpbmRleERCUHJvZHVjdCk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgICAgfSk7XHJcbiAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICBjb25zb2xlLmVycm9yKFwiRXJyb3IgcmV0cmlldmluZyBjYXJ0OlwiLCBlcnJvcik7XHJcbiAgICAgIHRocm93IGVycm9yO1xyXG4gICAgfVxyXG4gIH1cclxuXHJcblxyXG4gIGFkZFByb2R1Y3RUb0NhcnQocHJvZHVjdDogT3JkZXJlZEl0ZW1zKSB7XHJcblxyXG4gICAgY29uc3QgdHJhbnNhY3Rpb24gPSB0aGlzLmRhdGFiYXNlLnRyYW5zYWN0aW9uKHRoaXMuY2FydENvbGxlY3Rpb25OYW1lLCBcInJlYWR3cml0ZVwiKTtcclxuICAgIGNvbnN0IHJlc3Bv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gICAgdHJ5IHtcclxuICAgICAgICAgICAgICBjb25zdCByZXNwb25zZTogYW55ID0gYXdhaXQgdGhpcy5yZXN0U2VydmljZS5nZXRVc2VySXRlbXModXNlckRldGFpbHM/LnVzZXJJZCwgXCJDQVJUXCIpLnRvUHJvbWlzZSgpO1xyXG4gICAgICAgICAgICAgIGlmKHJlc3BvbnNlLmRhdGE/LlswXT8uY2FydElkKVxyXG4gICAgICAgICAgICAgICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0oJ2NhcnRJZCcsIHJlc3BvbnNlLmRhdGE/LlswXT8uY2FydElkKTtcclxuXHJcbiAgICAgICAgICAgICAgY29uc3Qgc2VydmVyREJQcm9kdWN0ID0gcmVzcG9uc2U/LmRhdGE/LlswXT8ub3JkZXJlZEl0ZW1zID8/IFtdO1xyXG5cclxuICAgICAgICAgICAgICBmb3IgKGxldCBsb2NhbFByb2R1Y3Qgb2YgaW5kZXhEQlByb2R1Y3QpIHtcclxuICAgICAgICAgICAgICAgIGxldCBwcm9kdWN0Rm91bmQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHNlcnZlclByb2R1Y3Qgb2Ygc2VydmVyREJQcm9kdWN0KSB7XHJcbiAgICAgICAgICAgICAgICAgIGlmIChzZXJ2ZXJQcm9kdWN0LnZhcmllbnRJZCA9PT0gbG9jYWxQcm9kdWN0LnZhcmllbnRJZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHNlcnZlclByb2R1Y3QucXVhbnRpdHkgKz0gbG9jYWxQcm9kdWN0LnF1YW50aXR5O1xyXG4gICAgICAgICAgICAgICAgICAgIHByb2R1Y3RGb3VuZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghcHJvZHVjdEZvdW5kKSB7XHJcbiAgICAgICAgICAgICAgICAgIHNlcnZlckRCUHJvZHVjdC5wdXNoKGxvY2FsUHJvZHVjdCk7X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