@daffodil/cart 0.63.0 → 0.63.2
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.
- package/driver/in-memory/package.json +1 -1
- package/driver/magento/package.json +1 -1
- package/driver/magento/testing/package.json +1 -1
- package/driver/package.json +1 -1
- package/driver/testing/package.json +1 -1
- package/esm2020/state/effects/cart-resolver.effects.mjs +9 -8
- package/fesm2015/daffodil-cart-state.mjs +8 -7
- package/fesm2015/daffodil-cart-state.mjs.map +1 -1
- package/fesm2020/daffodil-cart-state.mjs +8 -7
- package/fesm2020/daffodil-cart-state.mjs.map +1 -1
- package/package.json +1 -1
- package/routing/package.json +1 -1
- package/state/effects/cart-resolver.effects.d.ts +4 -3
- package/state/package.json +1 -1
- package/state/testing/package.json +1 -1
- package/testing/package.json +1 -1
|
@@ -3,9 +3,9 @@ import { createFeatureSelector, createSelector, defaultMemoize, select, combineR
|
|
|
3
3
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
4
4
|
import { daffComposeReducers } from '@daffodil/core/state';
|
|
5
5
|
import * as i4 from '@daffodil/cart/driver';
|
|
6
|
-
import { DaffCartDriverErrorCodes, DaffCartAddressDriver, DaffCartBillingAddressDriver, DaffCartCouponDriver, daffCartDriverHandleCartNotFound, DaffCartItemDriver, DaffCartOrderDriver, DaffCartPaymentMethodsDriver, DaffCartPaymentDriver,
|
|
6
|
+
import { DaffCartDriverErrorCodes, DaffCartAddressDriver, DaffCartBillingAddressDriver, DaffCartCouponDriver, daffCartDriverHandleCartNotFound, DaffCartItemDriver, DaffCartOrderDriver, DaffCartPaymentMethodsDriver, DaffCartPaymentDriver, DaffCartShippingAddressDriver, DaffCartShippingInformationDriver, DaffCartShippingMethodsDriver, DaffCartDriver } from '@daffodil/cart/driver';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
|
|
8
|
+
import { InjectionToken, Injectable, Inject, PLATFORM_ID, inject, NgModule } from '@angular/core';
|
|
9
9
|
import * as i2 from '@daffodil/cart';
|
|
10
10
|
import { DaffCartItemInputType, DaffCartTotalTypeEnum, DAFF_CART_ERROR_MATCHER, DaffCartResolutionError, DaffCartStorageResolutionError, DaffCartServerSideResolutionError, DaffCartPaymentMethodIdMap } from '@daffodil/cart';
|
|
11
11
|
import { daffAdd, DaffStorageServiceError, DaffInheritableError, DaffServerSideStorageError } from '@daffodil/core';
|
|
@@ -16,6 +16,7 @@ import { DaffPaymentGenerateTokenFailure, DAFF_PAYMENT_PROCESSOR_COLLECTION, daf
|
|
|
16
16
|
import { defer, of, combineLatest, iif, EMPTY } from 'rxjs';
|
|
17
17
|
import { switchMap, map, catchError, concatMap, mergeMap, debounceTime, take, tap } from 'rxjs/operators';
|
|
18
18
|
import { DAFF_PAYMENT_ERROR_MATCHER } from '@daffodil/payment';
|
|
19
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* An enum for the cart action types.
|
|
@@ -2498,12 +2499,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
2498
2499
|
* 3. If the cart resolution fails, it will bailout.
|
|
2499
2500
|
*/
|
|
2500
2501
|
class DaffCartResolverEffects {
|
|
2501
|
-
constructor(actions$, errorMatcher, cartStorage, cartResolver,
|
|
2502
|
+
constructor(actions$, errorMatcher, cartStorage, cartResolver, platformId) {
|
|
2502
2503
|
this.actions$ = actions$;
|
|
2503
2504
|
this.errorMatcher = errorMatcher;
|
|
2504
2505
|
this.cartStorage = cartStorage;
|
|
2505
2506
|
this.cartResolver = cartResolver;
|
|
2506
|
-
this.
|
|
2507
|
+
this.platformId = platformId;
|
|
2507
2508
|
this.onResolveCart = createEffect(() => () => this.actions$.pipe(ofType(DaffCartActionTypes.ResolveCartAction, DaffCartActionTypes.ResolveCartSuccessAction), switchMap(action => iif(
|
|
2508
2509
|
// if something else resolves the cart during an outstanding resolve
|
|
2509
2510
|
() => action.type === DaffCartActionTypes.ResolveCartSuccessAction,
|
|
@@ -2526,10 +2527,10 @@ class DaffCartResolverEffects {
|
|
|
2526
2527
|
}))))));
|
|
2527
2528
|
}
|
|
2528
2529
|
ngrxOnInitEffects() {
|
|
2529
|
-
return this.cartStorage.getCartId() ? new DaffResolveCart() : { type: '' };
|
|
2530
|
+
return isPlatformBrowser(this.platformId) && this.cartStorage.getCartId() ? new DaffResolveCart() : { type: '' };
|
|
2530
2531
|
}
|
|
2531
2532
|
}
|
|
2532
|
-
/** @nocollapse */ DaffCartResolverEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCartResolverEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: i2.DaffCartStorageService }, { token: i4.DaffCartDriverResolveService }, { token:
|
|
2533
|
+
/** @nocollapse */ DaffCartResolverEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCartResolverEffects, deps: [{ token: i1.Actions }, { token: DAFF_CART_ERROR_MATCHER }, { token: i2.DaffCartStorageService }, { token: i4.DaffCartDriverResolveService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2533
2534
|
/** @nocollapse */ DaffCartResolverEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCartResolverEffects });
|
|
2534
2535
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCartResolverEffects, decorators: [{
|
|
2535
2536
|
type: Injectable
|
|
@@ -2538,7 +2539,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
2538
2539
|
args: [DAFF_CART_ERROR_MATCHER]
|
|
2539
2540
|
}] }, { type: i2.DaffCartStorageService }, { type: i4.DaffCartDriverResolveService }, { type: undefined, decorators: [{
|
|
2540
2541
|
type: Inject,
|
|
2541
|
-
args: [
|
|
2542
|
+
args: [PLATFORM_ID]
|
|
2542
2543
|
}] }]; } });
|
|
2543
2544
|
|
|
2544
2545
|
class DaffCartShippingAddressEffects {
|