diff options
Diffstat (limited to 'webapp/components/admin_console/multiselect_settings.jsx')
-rw-r--r-- | webapp/components/admin_console/multiselect_settings.jsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/webapp/components/admin_console/multiselect_settings.jsx b/webapp/components/admin_console/multiselect_settings.jsx index ca0bdc9aa..8aad5d6eb 100644 --- a/webapp/components/admin_console/multiselect_settings.jsx +++ b/webapp/components/admin_console/multiselect_settings.jsx @@ -19,9 +19,7 @@ export default class MultiSelectSetting extends React.Component { return n.value; }); - if (!newValue || newValue.length === 0) { - this.setState({error: this.props.errorText}); - } else if (this.props.mustBePresent && values.join(',').indexOf(this.props.mustBePresent) === -1) { + if (this.props.selected.length > 0 && this.props.mustBePresent && values.join(',').indexOf(this.props.mustBePresent) === -1) { this.setState({error: this.props.notPresent}); } else { this.props.onChange(this.props.id, values); @@ -30,7 +28,7 @@ export default class MultiSelectSetting extends React.Component { } componentWillReceiveProps(newProps) { - if (newProps.mustBePresent && newProps.selected.join(',').indexOf(newProps.mustBePresent) === -1) { + if (newProps.selected.length > 0 && newProps.mustBePresent && newProps.selected.join(',').indexOf(newProps.mustBePresent) === -1) { this.setState({error: this.props.notPresent}); } else { this.setState({error: false}); |