Skip to content

Commit

Permalink
fix: updated code to fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Apr 8, 2024
1 parent 91c877e commit d5a059c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/payment/data/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const basket = (state = basketInitialState, action = null) => {
};

case BASKET_DATA_RECEIVED:
localStorage.setItem('sku', action.payload.products[0].sku);
if (action.payload.products && action.payload.products.length > 0) {
localStorage.setItem('sku', action.payload.products[0].sku);
}
return { ...state, ...action.payload };

case BASKET_PROCESSING: return {
Expand Down

0 comments on commit d5a059c

Please sign in to comment.