@ordergroove/offers 2.38.1 → 2.39.0
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/CHANGELOG.md +11 -0
- package/dist/bundle-report.html +6 -6
- package/dist/offers.js +27 -27
- package/dist/offers.js.map +3 -3
- package/package.json +2 -2
- package/src/core/constants.js +1 -1
- package/src/core/waitUntilOffersReady.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.39.0",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@ordergroove/offers-templates": "^0.9.6",
|
|
49
49
|
"@types/lodash.memoize": "^4.1.9"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "32d06763b4ca9fe174e2f4745495a39e01017f7f"
|
|
52
52
|
}
|
package/src/core/constants.js
CHANGED
|
@@ -17,11 +17,11 @@ export const CART_PRODUCT_KEY_HAS_CHANGED = 'CART_PRODUCT_KEY_HAS_CHANGED';
|
|
|
17
17
|
|
|
18
18
|
export const RECEIVE_ORDER_ITEMS = 'RECEIVE_ORDER_ITEMS';
|
|
19
19
|
export const FETCH_RESPONSE_ERROR = 'FETCH_RESPONSE_ERROR';
|
|
20
|
-
|
|
21
20
|
export const SET_ENVIRONMENT_LOCAL = 'SET_ENVIRONMENT_LOCAL';
|
|
22
21
|
export const SET_ENVIRONMENT_STAGING = 'SET_ENVIRONMENT_STAGING';
|
|
23
22
|
export const SET_ENVIRONMENT_DEV = 'SET_ENVIRONMENT_DEV';
|
|
24
23
|
export const SET_ENVIRONMENT_PROD = 'SET_ENVIRONMENT_PROD';
|
|
24
|
+
export const READY = 'READY';
|
|
25
25
|
export const CONCLUDE_UPSELL = 'CONCLUDE_UPSELL';
|
|
26
26
|
export const REQUEST_CREATE_IU_ORDER = 'REQUEST_CREATE_IU_ORDER';
|
|
27
27
|
export const CREATE_ONE_TIME = 'CREATE_ONE_TIME';
|
|
@@ -5,11 +5,12 @@ import {
|
|
|
5
5
|
SET_ENVIRONMENT_DEV,
|
|
6
6
|
SET_ENVIRONMENT_PROD,
|
|
7
7
|
SET_ENVIRONMENT_STAGING,
|
|
8
|
-
SET_MERCHANT_ID
|
|
8
|
+
SET_MERCHANT_ID,
|
|
9
|
+
READY
|
|
9
10
|
} from './constants';
|
|
10
11
|
import { listenLocalStorageChanges } from './localStorage';
|
|
11
12
|
|
|
12
|
-
const waitFor = () => {
|
|
13
|
+
export const waitFor = () => {
|
|
13
14
|
let resolve, reject;
|
|
14
15
|
return [
|
|
15
16
|
new Promise((yes, no) => {
|
|
@@ -42,6 +43,7 @@ export function waitUntilOffersReady(store) {
|
|
|
42
43
|
const waitForReady = Promise.all([waitForMerchantId, waitForSetEnv, waitForSessionId]);
|
|
43
44
|
|
|
44
45
|
waitForReady.then(() => {
|
|
46
|
+
store.dispatch({ type: READY, payload: {} });
|
|
45
47
|
window.addEventListener('storage', listenLocalStorageChanges(store));
|
|
46
48
|
if (!store.getState().auth?.ts) {
|
|
47
49
|
store.dispatch(fetchAuth());
|