Fixed: Clear season search results when navigating to another page

pull/5870/head
Bogdan 11 months ago committed by GitHub
parent a5aab810d7
commit 67dc898797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,7 @@ class EpisodeDetailsModalContentConnector extends Component {
// Lifecycle
componentWillUnmount() {
// Clear pending releases here so we can reshow the search
// Clear pending releases here, so we can reshow the search
// results even after switching tabs.
this.props.dispatchCancelFetchReleases();
@ -75,6 +75,7 @@ class EpisodeDetailsModalContentConnector extends Component {
render() {
const {
dispatchCancelFetchReleases,
dispatchClearReleases,
...otherProps
} = this.props;

@ -1,9 +1,19 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { cancelFetchReleases, clearReleases } from 'Store/Actions/releaseActions';
import SeasonInteractiveSearchModal from './SeasonInteractiveSearchModal';
function createMapDispatchToProps(dispatch, props) {
return {
dispatchCancelFetchReleases() {
dispatch(cancelFetchReleases());
},
dispatchClearReleases() {
dispatch(clearReleases());
},
onModalClose() {
dispatch(cancelFetchReleases());
dispatch(clearReleases());
@ -12,4 +22,38 @@ function createMapDispatchToProps(dispatch, props) {
};
}
export default connect(null, createMapDispatchToProps)(SeasonInteractiveSearchModal);
class SeasonInteractiveSearchModalConnector extends Component {
//
// Lifecycle
componentWillUnmount() {
this.props.dispatchCancelFetchReleases();
this.props.dispatchClearReleases();
}
//
// Render
render() {
const {
dispatchCancelFetchReleases,
dispatchClearReleases,
...otherProps
} = this.props;
return (
<SeasonInteractiveSearchModal
{...otherProps}
/>
);
}
}
SeasonInteractiveSearchModalConnector.propTypes = {
...SeasonInteractiveSearchModal.propTypes,
dispatchCancelFetchReleases: PropTypes.func.isRequired,
dispatchClearReleases: PropTypes.func.isRequired
};
export default connect(null, createMapDispatchToProps)(SeasonInteractiveSearchModalConnector);

Loading…
Cancel
Save