Fixed: History should reload on MovieDetail Movie Change

pull/2/head
Qstick 5 years ago
parent 162980ccaf
commit ee7e507cde

@ -35,6 +35,20 @@ class MovieHistoryTableContentConnector extends Component {
}); });
} }
componentDidUpdate(prevProps) {
const {
movieId
} = this.props;
// If the id has changed we need to clear the history
if (prevProps.movieId !== movieId) {
this.props.clearMovieHistory();
this.props.fetchMovieHistory({
movieId
});
}
}
componentWillUnmount() { componentWillUnmount() {
this.props.clearMovieHistory(); this.props.clearMovieHistory();
} }

Loading…
Cancel
Save