Skip to content

Commit

Permalink
Merge pull request #310 from magento-south/MAGETWO-46891-2.0
Browse files Browse the repository at this point in the history
[SOUTH] Bug
  • Loading branch information
Korshenko, Olexii(okorshenko) committed Jan 15, 2016
2 parents ee8ba2a + ca03c88 commit 398ecd5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ define(
function($, address, customerData, mageUtils) {
'use strict';
var countryData = customerData.get('directory-data');
if (_.isEmpty(countryData())) {
countryData(customerData.reload(['directory-data'], false));
}

return {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ define(
});
addressOptions.push(newAddressOption);

if (_.isEmpty(countryData())) {
countryData(customerData.reload(['directory-data'], false));
}

return Component.extend({
defaults: {
template: 'Magento_Checkout/billing-address'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ define([
], function($, ko, Component, selectShippingAddressAction, quote, formPopUpState, checkoutData, customerData) {
'use strict';
var countryData = customerData.get('directory-data');
if (_.isEmpty(countryData())) {
countryData(customerData.reload(['directory-data'], false));
}

return Component.extend({
defaults: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ define([
], function(Component, customerData) {
'use strict';
var countryData = customerData.get('directory-data');
if (_.isEmpty(countryData())) {
countryData(customerData.reload(['directory-data'], false));
}

return Component.extend({
defaults: {
Expand Down
14 changes: 13 additions & 1 deletion app/code/Magento/Customer/view/frontend/web/js/customer-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ define([

var customerData = {
init: function() {
var countryData,
privateContent = $.cookieStorage.get('private_content_version');

if (_.isEmpty(storage.keys())) {
this.reload([], false);
if (!_.isEmpty(privateContent)) {
this.reload([], false);
}
} else if (this.needReload()) {
_.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) {
buffer.notify(sectionName, sectionData);
Expand All @@ -119,6 +124,13 @@ define([
this.reload(storageInvalidation.keys(), false);
}
}

if (!_.isEmpty(privateContent)) {
countryData = this.get('directory-data');
if (_.isEmpty(countryData())) {
countryData(customerData.reload(['directory-data'], false));
}
}
},
needReload: function () {
var cookieSections = $.cookieStorage.get('section_data_ids');
Expand Down

0 comments on commit 398ecd5

Please sign in to comment.