Fixed: Trying to add an artist when root folders hadn't populated

Fixed #1257
pull/4068/head
Mark McDowall 5 years ago committed by Bogdan
parent 110a7b74e7
commit f47e5084e8

@ -90,6 +90,27 @@ class RootFolderSelectInputConnector extends Component {
} }
} }
componentDidUpdate(prevProps) {
const {
name,
value,
values,
onChange
} = this.props;
if (prevProps.values === values) {
return;
}
if (!value && values.length && values.some((v) => !!v.key && v.key !== ADD_NEW_KEY)) {
const defaultValue = values[0];
if (defaultValue.key !== ADD_NEW_KEY) {
onChange({ name, value: defaultValue.key });
}
}
}
// //
// Render // Render

Loading…
Cancel
Save