@nuskin/ns-shop 7.1.5 → 7.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-shop",
3
- "version": "7.1.5",
3
+ "version": "7.1.6",
4
4
  "description": "The description that will amaze and astound your audience when they read it",
5
5
  "main": "src/shop.js",
6
6
  "scripts": {
@@ -4,6 +4,9 @@ import {RunConfigService} from '@nuskin/ns-util';
4
4
  import {OrderManager, CartService, OrderType, OrderAdapter} from '../shop';
5
5
  import axios from 'axios';
6
6
 
7
+ const SHIP_METHODS = 'shipMethods';
8
+ const Pick_UP_POINTS = 'pickUpPoints';
9
+
7
10
  let PickupUtil = function() {
8
11
  'use strict';
9
12
  const SERVICE_GROUP = 'SERVICE_GROUP',
@@ -22,8 +25,6 @@ let PickupUtil = function() {
22
25
  CARRIER_CODE = 'CARRIER_CODE';
23
26
 
24
27
  let promise = Promise.resolve();
25
- let shipMethods = [];
26
- let pickupPoints = [];
27
28
 
28
29
  /**
29
30
  * Pickup Point shipping methods.
@@ -190,12 +191,12 @@ let PickupUtil = function() {
190
191
  }
191
192
  }
192
193
  ).then((results) => {
193
- shipMethods = results.data.shipMethods;
194
- pickupPoints = results.data.pickupPoints;
194
+ sessionStorage.setItem(SHIP_METHODS, JSON.stringify(results.data.shipMethods))
195
+ sessionStorage.setItem(Pick_UP_POINTS, JSON.stringify(results.data.pickupPoints))
195
196
  }).catch((err) => {
196
197
  console.log(err);
197
- shipMethods = [];
198
- pickupPoints = [];
198
+ sessionStorage.setItem(SHIP_METHODS, JSON.stringify([]));
199
+ sessionStorage.setItem(Pick_UP_POINTS, JSON.stringify([]));
199
200
  });
200
201
  }
201
202
  }
@@ -203,13 +204,13 @@ let PickupUtil = function() {
203
204
  async function getShipMethods() {
204
205
  await promise;
205
206
 
206
- return shipMethods;
207
+ return JSON.parse((sessionStorage.getItem(SHIP_METHODS) || []));
207
208
  }
208
209
 
209
210
  async function getPickupPoints() {
210
211
  await promise;
211
212
 
212
- return pickupPoints;
213
+ return JSON.parse(sessionStorage.getItem(Pick_UP_POINTS) || []);
213
214
  }
214
215
 
215
216
  return {