|
@@ -154,7 +154,7 @@ const actionAddOrder = (cart) => {
|
|
|
|
|
|
//cart
|
|
|
function cartReducer(state={}, {type, good, price, count=1}) {
|
|
|
- if (Object.keys(state).length === 0 && localStorage.cart.length > 10) {
|
|
|
+ if (Object.keys(state).length === 0 && localStorage.cart?.length > 10) {
|
|
|
let newState = JSON.parse(localStorage.cart)
|
|
|
return newState
|
|
|
}
|
|
@@ -279,6 +279,7 @@ window.onhashchange = () => {
|
|
|
drawCart()
|
|
|
}
|
|
|
}
|
|
|
+window.onhashchange()
|
|
|
|
|
|
function drawMainMenu(){
|
|
|
let cats = store.getState().promise.rootCategories.payload
|