Skip to content

Commit

Permalink
fixing cart number issue on page refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayDoddapaneni committed Jan 8, 2021
1 parent 5e6f066 commit a52e165
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/NavBar/NavBarContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -14,6 +15,9 @@ export default compose(
{ toggleSidebar },
),
lifecycle({
componentDidMount() {
initCart();
},
shouldComponentUpdate({ location: nextLocation }) {
const pathName = this.props.location.pathname;
return (
Expand Down

0 comments on commit a52e165

Please sign in to comment.