Skip to content

Commit 8a4de15

Browse files
Merge remote-tracking branch 'remotes/origin/#523' into allfunctionality
2 parents 3dbbeaf + ba5e92d commit 8a4de15

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

js/components/preview/compounds/redux/dispatchActions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,16 @@ export const handleClickOnCompound = ({ event, data, majorViewStage, index }) =>
215215
}
216216
};
217217

218-
export const handleBuyList = ({ isSelected, data }) => (dispatch, getState) => {
218+
export const handleBuyList = ({ isSelected, data, skipTracking }) => (dispatch, getState) => {
219219
let compoundId = data.compoundId;
220220
dispatch(setHighlightedCompoundId(compoundId));
221221

222222
if (isSelected === false) {
223223
dispatch(removeSelectedCompoundClass(compoundId));
224-
dispatch(removeFromToBuyList(data, compoundId, true));
224+
dispatch(removeFromToBuyList(data, compoundId, skipTracking));
225225
} else {
226226
dispatch(addSelectedCompoundClass(data.class, compoundId));
227-
dispatch(appendToBuyList(Object.assign({}, data), compoundId, true));
227+
dispatch(appendToBuyList(Object.assign({}, data), compoundId, skipTracking));
228228
}
229229
};
230230

js/reducers/tracking/dispatchActions.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -926,14 +926,16 @@ const restoreCartActions = (orderedActionList, majorViewStage) => async (dispatc
926926
);
927927
if (shoppingCartActions) {
928928
shoppingCartActions.forEach(action => {
929-
shoppingCartItems.push(action.item);
929+
if (action.item) {
930+
shoppingCartItems.push(action.item);
931+
}
930932
});
931933
}
932934

933935
shoppingCartItems.forEach(item => {
934936
let data = item;
935937
if (data) {
936-
dispatch(handleBuyList({ isSelected: true, data }));
938+
dispatch(handleBuyList({ isSelected: true, data, skipTracking: true }));
937939
}
938940
});
939941

@@ -2013,7 +2015,7 @@ const handleShoppingCartAction = (action, isAdd) => (dispatch, getState) => {
20132015
if (action) {
20142016
let data = action.item;
20152017
if (data) {
2016-
dispatch(handleBuyList({ isSelected: isAdd, data }));
2018+
dispatch(handleBuyList({ isSelected: isAdd, data, skipTracking: false }));
20172019
}
20182020
}
20192021
};

0 commit comments

Comments
 (0)