Skip to content

Commit 1884fd8

Browse files
author
Oleksii Korshenko
committed
MAGETWO-68877: Issue #7988 Typo changed also added comments for each index, getters and setters. #9484
- fixed merge conflict
1 parent 1e87862 commit 1884fd8

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,36 @@ define([
1515
'use strict';
1616

1717
var cacheKey = 'checkout-data',
18-
checkoutData,
19-
20-
/**
21-
* @return {*}
22-
*/
23-
getData = function () {
24-
return storage.get(cacheKey)();
25-
},
2618

2719
/**
2820
* @param {Object} data
2921
*/
3022
saveData = function (data) {
3123
storage.set(cacheKey, data);
32-
};
24+
},
3325

34-
if ($.isEmptyObject(getData())) {
35-
checkoutData = {
36-
'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage
37-
'shippingAddressFromData': null, //Shipping address pulled from persistence storage
38-
'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for new customer
39-
'selectedShippingRate': null, //Shipping rate pulled from persistence storage
40-
'selectedPaymentMethod': null, //Payment method pulled from persistence storage
41-
'selectedBillingAddress': null, //Selected billing address pulled from persistence storage
42-
'billingAddressFromData': null, //Billing address pulled from persistence storage
43-
'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer
26+
/**
27+
* @return {*}
28+
*/
29+
getData = function () {
30+
var data = storage.get(cacheKey)();
31+
32+
if ($.isEmptyObject(data)) {
33+
data = {
34+
'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage
35+
'shippingAddressFromData': null, //Shipping address pulled from persistence storage
36+
'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for customer
37+
'selectedShippingRate': null, //Shipping rate pulled from persistence storage
38+
'selectedPaymentMethod': null, //Payment method pulled from persistence storage
39+
'selectedBillingAddress': null, //Selected billing address pulled from persistence storage
40+
'billingAddressFromData': null, //Billing address pulled from persistence storage
41+
'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer
42+
};
43+
saveData(data);
44+
}
45+
46+
return data;
4447
};
45-
saveData(checkoutData);
46-
}
4748

4849
return {
4950
/**

0 commit comments

Comments
 (0)