mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-16 23:39:44 +02:00
Fixed: Clear movie search results when navigating to another page
(cherry picked from commit 67dc8987970aa2a9eade48c02ae72be1851fa196)
This commit is contained in:
parent
8e0645670b
commit
88c0e24c58
@ -1,9 +1,19 @@
|
|||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { cancelFetchReleases, clearReleases } from 'Store/Actions/releaseActions';
|
import { cancelFetchReleases, clearReleases } from 'Store/Actions/releaseActions';
|
||||||
import MovieInteractiveSearchModal from './MovieInteractiveSearchModal';
|
import MovieInteractiveSearchModal from './MovieInteractiveSearchModal';
|
||||||
|
|
||||||
function createMapDispatchToProps(dispatch, props) {
|
function createMapDispatchToProps(dispatch, props) {
|
||||||
return {
|
return {
|
||||||
|
dispatchCancelFetchReleases() {
|
||||||
|
dispatch(cancelFetchReleases());
|
||||||
|
},
|
||||||
|
|
||||||
|
dispatchClearReleases() {
|
||||||
|
dispatch(clearReleases());
|
||||||
|
},
|
||||||
|
|
||||||
onModalClose() {
|
onModalClose() {
|
||||||
dispatch(cancelFetchReleases());
|
dispatch(cancelFetchReleases());
|
||||||
dispatch(clearReleases());
|
dispatch(clearReleases());
|
||||||
@ -12,4 +22,38 @@ function createMapDispatchToProps(dispatch, props) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(null, createMapDispatchToProps)(MovieInteractiveSearchModal);
|
class MovieInteractiveSearchModalConnector extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.props.dispatchCancelFetchReleases();
|
||||||
|
this.props.dispatchClearReleases();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
dispatchCancelFetchReleases,
|
||||||
|
dispatchClearReleases,
|
||||||
|
...otherProps
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MovieInteractiveSearchModal
|
||||||
|
{...otherProps}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MovieInteractiveSearchModalConnector.propTypes = {
|
||||||
|
...MovieInteractiveSearchModal.propTypes,
|
||||||
|
dispatchCancelFetchReleases: PropTypes.func.isRequired,
|
||||||
|
dispatchClearReleases: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, createMapDispatchToProps)(MovieInteractiveSearchModalConnector);
|
||||||
|
Loading…
Reference in New Issue
Block a user