|
@@ -100,9 +100,10 @@ const actionAuthLogout = () => ({type: 'AUTH_LOGOUT'})
|
|
|
function cartReducer (state={}, {type, good={}, count=1}) {
|
|
|
|
|
|
// if (!state) {
|
|
|
+ // localStorage.cart = JSON.stringify({})
|
|
|
// return {}
|
|
|
// }
|
|
|
- if (Object.keys(state).length === 0) {
|
|
|
+ if (Object.keys(state).length === 0 && localStorage.cart) {
|
|
|
let currCart = JSON.parse(localStorage.cart)
|
|
|
if (currCart && Object.keys(currCart).length !== 0) {
|
|
|
state = currCart
|