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:
parent
a5aab810d7
commit
67dc898797
@ -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…
Reference in New Issue
Block a user