1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-19 21:46:43 -04:00

Fixed: Trying to add a series when root folders hadn't populated

Fixed #3387
This commit is contained in:
Mark McDowall
2019-11-14 08:32:54 -08:00
parent 06d57e8f32
commit a6d0dddaf7
2 changed files with 24 additions and 0 deletions
@@ -95,6 +95,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 });
}
}
}
//
// Listeners