mirror of https://github.com/lidarr/Lidarr
Fixed: Clear pending releases to prevent stale results
This commit is contained in:
parent
27518a27fb
commit
86776e6d2e
|
@ -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 AlbumInteractiveSearchModal from './AlbumInteractiveSearchModal';
|
import AlbumInteractiveSearchModal from './AlbumInteractiveSearchModal';
|
||||||
|
|
||||||
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)(AlbumInteractiveSearchModal);
|
class AlbumInteractiveSearchModalConnector extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.props.dispatchCancelFetchReleases();
|
||||||
|
this.props.dispatchClearReleases();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
dispatchCancelFetchReleases,
|
||||||
|
dispatchClearReleases,
|
||||||
|
...otherProps
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AlbumInteractiveSearchModal
|
||||||
|
{...otherProps}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AlbumInteractiveSearchModalConnector.propTypes = {
|
||||||
|
...AlbumInteractiveSearchModal.propTypes,
|
||||||
|
dispatchCancelFetchReleases: PropTypes.func.isRequired,
|
||||||
|
dispatchClearReleases: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, createMapDispatchToProps)(AlbumInteractiveSearchModalConnector);
|
||||||
|
|
|
@ -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 ArtistInteractiveSearchModal from './ArtistInteractiveSearchModal';
|
import ArtistInteractiveSearchModal from './ArtistInteractiveSearchModal';
|
||||||
|
|
||||||
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)(ArtistInteractiveSearchModal);
|
class ArtistInteractiveSearchModalConnector extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.props.dispatchCancelFetchReleases();
|
||||||
|
this.props.dispatchClearReleases();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
dispatchCancelFetchReleases,
|
||||||
|
dispatchClearReleases,
|
||||||
|
...otherProps
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ArtistInteractiveSearchModal
|
||||||
|
{...otherProps}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ArtistInteractiveSearchModalConnector.propTypes = {
|
||||||
|
...ArtistInteractiveSearchModal.propTypes,
|
||||||
|
dispatchCancelFetchReleases: PropTypes.func.isRequired,
|
||||||
|
dispatchClearReleases: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, createMapDispatchToProps)(ArtistInteractiveSearchModalConnector);
|
||||||
|
|
Loading…
Reference in New Issue