Check upstream length in component

This commit is contained in:
Ildar Kamalov 2018-09-21 18:50:06 +03:00
parent f727f999f9
commit c2a2b3ea6a
3 changed files with 18 additions and 18 deletions
client/src/components/Settings

View file

@ -44,7 +44,11 @@ export default class Settings extends Component {
};
handleUpstreamTest = () => {
this.props.testUpstream(this.props.settings.upstream);
if (this.props.settings.upstream.length > 0) {
this.props.testUpstream(this.props.settings.upstream);
} else {
this.props.addErrorToast({ error: 'No servers specified' });
}
};
renderSettings = (settings) => {