mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fixed: Error displayed occasionally after removing artist
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
63f9338d2f
commit
f0365eaaa7
1 changed files with 17 additions and 1 deletions
|
@ -48,6 +48,16 @@ function createMapStateToProps() {
|
||||||
showSearchAction,
|
showSearchAction,
|
||||||
executingCommands
|
executingCommands
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
|
// If an artist is deleted this selector may fire before the parent
|
||||||
|
// selectors, which will result in an undefined artist, if that happens
|
||||||
|
// we want to return early here and again in the render function to avoid
|
||||||
|
// trying to show an artist that has no information available.
|
||||||
|
|
||||||
|
if (!artist) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
const isRefreshingArtist = executingCommands.some((command) => {
|
const isRefreshingArtist = executingCommands.some((command) => {
|
||||||
return (
|
return (
|
||||||
command.name === commandNames.REFRESH_ARTIST &&
|
command.name === commandNames.REFRESH_ARTIST &&
|
||||||
|
@ -106,13 +116,19 @@ class ArtistIndexItemConnector extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
id,
|
||||||
component: ItemComponent,
|
component: ItemComponent,
|
||||||
...otherProps
|
...otherProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
if (!id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ItemComponent
|
<ItemComponent
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
|
id={id}
|
||||||
onRefreshArtistPress={this.onRefreshArtistPress}
|
onRefreshArtistPress={this.onRefreshArtistPress}
|
||||||
onSearchPress={this.onSearchPress}
|
onSearchPress={this.onSearchPress}
|
||||||
/>
|
/>
|
||||||
|
@ -121,7 +137,7 @@ class ArtistIndexItemConnector extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtistIndexItemConnector.propTypes = {
|
ArtistIndexItemConnector.propTypes = {
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number,
|
||||||
component: PropTypes.func.isRequired,
|
component: PropTypes.func.isRequired,
|
||||||
executeCommand: PropTypes.func.isRequired
|
executeCommand: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue