Skip to content

Commit 8009741

Browse files
MAGETWO-94406: [2.3.0] "Directory Data" and "Cart" sections are loaded twice after user logged in
- Updated retrieve attribute collection
1 parent 232e5c0 commit 8009741

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ define([
101101
self.isLoading(true);
102102
});
103103

104-
if ((cartData()['website_id'] !== window.checkout.websiteId) && !customerData.get('is-loading')) {
104+
if (cartData()['website_id'] !== window.checkout.websiteId) {
105105
customerData.reload(['cart'], false);
106106
}
107107

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,9 @@ define([
8787
} : [];
8888
parameters['update_section_id'] = updateSectionId;
8989

90-
return $.getJSON(options.sectionLoadUrl, parameters)
91-
.done(
92-
function () {
93-
if (_.isEmpty(sectionNames)) {
94-
customerData.set('is_loading', false);
95-
}
96-
}
97-
).fail(function (jqXHR) {
98-
throw new Error(jqXHR);
99-
});
90+
return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {
91+
throw new Error(jqXHR);
92+
});
10093
}
10194
};
10295

@@ -216,15 +209,15 @@ define([
216209
$.cookieStorage.set(privateContentVersion, needVersion);
217210
$.localStorage.set(privateContentVersion, needVersion);
218211
this.reload([], false);
219-
this.set('is_loading', true);
212+
isLoading = true;
220213
} else if (localPrivateContent !== privateContent) {
221214
if (!$.cookieStorage.isSet(privateContentVersion)) {
222215
privateContent = needVersion;
223216
$.cookieStorage.set(privateContentVersion, privateContent);
224217
}
225218
$.localStorage.set(privateContentVersion, privateContent);
226219
this.reload([], false);
227-
this.set('is_loading', true);
220+
isLoading = true;
228221
} else if (expiredSectionNames.length > 0) {
229222
_.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) {
230223
buffer.notify(sectionName, sectionData);
@@ -242,7 +235,6 @@ define([
242235

243236
if (!_.isEmpty(privateContent)) {
244237
countryData = this.get('directory-data');
245-
isLoading = this.get('is_loading');
246238

247239
if (_.isEmpty(countryData()) && !isLoading) {
248240
customerData.reload(['directory-data'], false);

0 commit comments

Comments
 (0)