File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import MyRouter from "../Router";
55import { deleteToken , authFalse } from "../../store/actions/user" ;
66import { resetHistoryOrders } from "../../store/actions/orders" ;
77import { resetCategory } from "../../store/actions/category" ;
8+ import { resetCart } from "../../store/actions/cart" ;
89import { connect } from "react-redux" ;
910import WaveAnimationComponent from "../Animation/WaveAnimation" ;
1011import NavbarWithToken from "./NavbarWithToken" ;
@@ -14,16 +15,21 @@ class Navbare extends Component {
1415 deleteToken ( ) {
1516 this . props . authFalse ( ) ;
1617 this . props . deleteToken ( ) ;
17- this . props . history . push ( "/" ) ;
1818 this . props . resetHistoryOrders ( ) ;
1919 this . props . resetCategory ( ) ;
20+ this . props . resetCart ( ) ;
21+ this . props . history . push ( "/" ) ;
2022 }
2123
2224 render ( ) {
2325 return (
2426 < div >
2527 < WaveAnimationComponent />
26- { this . props . token ? < NavbarWithToken onClick = { this . deleteToken . bind ( this ) } /> : < NavbarWithoutToken /> }
28+ { this . props . token ? (
29+ < NavbarWithToken onClick = { this . deleteToken . bind ( this ) } />
30+ ) : (
31+ < NavbarWithoutToken />
32+ ) }
2733 < MyRouter />
2834 </ div >
2935 ) ;
@@ -39,6 +45,7 @@ const mapDispatchToProps = {
3945 authFalse,
4046 resetHistoryOrders,
4147 resetCategory,
48+ resetCart,
4249} ;
4350export default connect (
4451 mapStateToProps ,
You can’t perform that action at this time.
0 commit comments