1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 07:22:35 +01:00

Fixed: Clear season search results when navigating to another page

This commit is contained in:
Bogdan 2023-08-02 03:02:25 +03:00 committed by GitHub
parent a5aab810d7
commit 67dc898797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 2 deletions

View File

@ -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;

View File

@ -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);