Skip to content

Commit 860b2d0

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-92308' into 2.3-develop-pr24
2 parents c40cafa + 1525c69 commit 860b2d0

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/totals.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@ define([
1414
'use strict';
1515

1616
var quoteItems = ko.observable(quote.totals().items),
17-
cartData = customerData.get('cart');
17+
cartData = customerData.get('cart'),
18+
quoteSubtotal = parseFloat(quote.totals().subtotal),
19+
subtotalAmount = parseFloat(cartData().subtotalAmount);
1820

1921
quote.totals.subscribe(function (newValue) {
2022
quoteItems(newValue.items);
2123
});
2224

23-
cartData.subscribe(function () {
24-
var quoteSubtotal = parseFloat(quote.totals().subtotal),
25-
subtotalAmount = parseFloat(cartData().subtotalAmount);
26-
27-
if (quoteSubtotal !== subtotalAmount) {
28-
customerData.reload(['cart'], false);
29-
}
30-
}, this);
25+
if (quoteSubtotal !== subtotalAmount) {
26+
customerData.reload(['cart'], false);
27+
}
3128

3229
return {
3330
totals: quote.totals,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ define([
9494
this.isLoading(addToCartCalls > 0);
9595
sidebarInitialized = false;
9696
this.update(updatedCart);
97-
98-
if (cartData()['website_id'] !== window.checkout.websiteId) {
99-
customerData.reload(['cart'], false);
100-
}
10197
initSidebar();
10298
}, this);
10399
$('[data-block="minicart"]').on('contentLoading', function () {
104100
addToCartCalls++;
105101
self.isLoading(true);
106102
});
107103

104+
if (cartData()['website_id'] !== window.checkout.websiteId) {
105+
customerData.reload(['cart'], false);
106+
}
107+
108108
return this._super();
109109
},
110110
isLoading: ko.observable(false),

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,9 @@ define([
232232
if (!_.isEmpty(privateContent)) {
233233
countryData = this.get('directory-data');
234234

235-
countryData.subscribe(function () {
236-
if (_.isEmpty(countryData())) {
237-
customerData.reload(['directory-data'], false);
238-
}
239-
}, this);
235+
if (_.isEmpty(countryData())) {
236+
customerData.reload(['directory-data'], false);
237+
}
240238
}
241239
},
242240

0 commit comments

Comments
 (0)