@@ -24,6 +24,22 @@ define([
24
24
storage . set ( cacheKey , data ) ;
25
25
} ,
26
26
27
+ /**
28
+ * @return {* }
29
+ */
30
+ initData = function ( ) {
31
+ return {
32
+ 'selectedShippingAddress' : null , //Selected shipping address pulled from persistence storage
33
+ 'shippingAddressFromData' : null , //Shipping address pulled from persistence storage
34
+ 'newCustomerShippingAddress' : null , //Shipping address pulled from persistence storage for customer
35
+ 'selectedShippingRate' : null , //Shipping rate pulled from persistence storage
36
+ 'selectedPaymentMethod' : null , //Payment method pulled from persistence storage
37
+ 'selectedBillingAddress' : null , //Selected billing address pulled from persistence storage
38
+ 'billingAddressFromData' : null , //Billing address pulled from persistence storage
39
+ 'newCustomerBillingAddress' : null //Billing address pulled from persistence storage for new customer
40
+ }
41
+ } ,
42
+
27
43
/**
28
44
* @return {* }
29
45
*/
@@ -32,26 +48,14 @@ define([
32
48
33
49
if ( $ . isEmptyObject ( data ) ) {
34
50
data = $ . initNamespaceStorage ( 'mage-cache-storage' ) . localStorage . get ( cacheKey ) ;
51
+
35
52
if ( $ . isEmptyObject ( data ) ) {
36
53
data = initData ( ) ;
37
54
saveData ( data ) ;
38
55
}
39
56
}
40
57
41
58
return data ;
42
- } ,
43
-
44
- initData = function ( ) {
45
- return {
46
- 'selectedShippingAddress' : null , //Selected shipping address pulled from persistence storage
47
- 'shippingAddressFromData' : null , //Shipping address pulled from persistence storage
48
- 'newCustomerShippingAddress' : null , //Shipping address pulled from persistence storage for customer
49
- 'selectedShippingRate' : null , //Shipping rate pulled from persistence storage
50
- 'selectedPaymentMethod' : null , //Payment method pulled from persistence storage
51
- 'selectedBillingAddress' : null , //Selected billing address pulled from persistence storage
52
- 'billingAddressFromData' : null , //Billing address pulled from persistence storage
53
- 'newCustomerBillingAddress' : null //Billing address pulled from persistence storage for new customer
54
- }
55
59
} ;
56
60
57
61
return {
0 commit comments