Skip to content

Commit b6b7f20

Browse files
author
WebDeveloperGuide
committed
Remove Cart and Address data if User Logged Out - 2
1 parent 28d4a34 commit b6b7f20

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

web_panel/src/redux/constants/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const ActionTypes = {
99
DECREASE_ITEM:"DECREASE_ITEM",
1010
CART_SAVE_SHIPPING_ADDRESS:"CART_SAVE_SHIPPING_ADDRESS",
1111
CART_SAVE_PAYMENT_METHOD:"CART_SAVE_PAYMENT_METHOD",
12-
CLEAR_CART_ITEM:"CLEAR_CART_ITEM"
12+
CLEAR_CART_ITEM:"CLEAR_CART_ITEM",
13+
CART_REMOVE_SHIPPING_ADDRESS:"CART_REMOVE_SHIPPING_ADDRESS"
1314
}
1415

1516

web_panel/src/redux/reducers/cartReducer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export const cartReducer = (state = initialState,{type,payload}) => {
7979
...state,
8080
shippingAddress: payload,
8181
};
82+
case ActionTypes.CART_REMOVE_SHIPPING_ADDRESS:
83+
return {
84+
...state,
85+
shippingAddress: {},
86+
};
8287
case ActionTypes.CLEAR_CART_ITEM:
8388
return {
8489
...state,

0 commit comments

Comments
 (0)