From a52e1650419c956399518af33389f93f2fe4709e Mon Sep 17 00:00:00 2001 From: Ajay Doddapaneni Date: Fri, 8 Jan 2021 10:44:39 -0500 Subject: [PATCH] fixing cart number issue on page refresh --- src/components/NavBar/NavBarContainer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/NavBar/NavBarContainer.js b/src/components/NavBar/NavBarContainer.js index 1e31d9504..174240c7b 100755 --- a/src/components/NavBar/NavBarContainer.js +++ b/src/components/NavBar/NavBarContainer.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import NavBarView from './NavBarView'; import { toggleSidebar } from '../Layout/LayoutState'; +import { initCart } from '../../pages/fileCentricCart/store/cart'; export default compose( withRouter, @@ -14,6 +15,9 @@ export default compose( { toggleSidebar }, ), lifecycle({ + componentDidMount() { + initCart(); + }, shouldComponentUpdate({ location: nextLocation }) { const pathName = this.props.location.pathname; return (