1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Fixed: Error displayed occasionally after removing series from the series list

Fixes #3018
This commit is contained in:
Mark McDowall 2019-04-04 19:35:06 -07:00
parent 8087996c8e
commit fdc7a19628

View File

@ -42,6 +42,16 @@ function createMapStateToProps() {
showSearchAction,
executingCommands
) => {
// If a series is deleted this selector may fire before the parent
// selecors, which will result in an undefined series, if that happens
// we want to return early here and again in the render function to avoid
// trying to show a series that has no information available.
if (!series) {
return {};
}
const isRefreshingSeries = executingCommands.some((command) => {
return (
command.name === commandNames.REFRESH_SERIES &&
@ -99,13 +109,19 @@ class SeriesIndexItemConnector extends Component {
render() {
const {
id,
component: ItemComponent,
...otherProps
} = this.props;
if (!id) {
return null;
}
return (
<ItemComponent
{...otherProps}
id={id}
onRefreshSeriesPress={this.onRefreshSeriesPress}
onSearchPress={this.onSearchPress}
/>
@ -114,7 +130,7 @@ class SeriesIndexItemConnector extends Component {
}
SeriesIndexItemConnector.propTypes = {
id: PropTypes.number.isRequired,
id: PropTypes.number,
component: PropTypes.func.isRequired,
executeCommand: PropTypes.func.isRequired
};