fixed bug with amount not updating / solved double dispatch problem with cartAction.load / removed all console.log calls - it became too chatty / add them as needed
This commit is contained in:
@@ -40,7 +40,9 @@ var CartIcon = React.createClass({
|
||||
// Add change listeners to stores
|
||||
componentDidMount: function() {
|
||||
CartStore.addChangeListener(this._onChange);
|
||||
CartActions.load();
|
||||
if(!CartStore.dataStartedLoading()) {
|
||||
CartActions.load();
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -51,6 +53,7 @@ var CartIcon = React.createClass({
|
||||
|
||||
_onChange: function () {
|
||||
if (this.isMounted()) {
|
||||
|
||||
this.setState(CartStore.getWholeCartState());
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user