Use correct ssl property name, closes #14

This commit is contained in:
Ken-Håvard Lieng 2018-05-18 05:33:33 +02:00
parent d27d108a07
commit 2f2c500453
2 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@ class Connect extends Component {
} else if (!e.target.checked && values.port === '6697') { } else if (!e.target.checked && values.port === '6697') {
setFieldValue('port', '6667', false); setFieldValue('port', '6667', false);
} }
setFieldValue('ssl', e.target.checked); setFieldValue('tls', e.target.checked);
}; };
handleShowClick = () => { handleShowClick = () => {
@ -77,7 +77,7 @@ class Connect extends Component {
<div className="connect-form-address"> <div className="connect-form-address">
<TextInput name="host" placeholder="Host" /> <TextInput name="host" placeholder="Host" />
<TextInput name="port" placeholder="Port" /> <TextInput name="port" placeholder="Port" />
<Checkbox name="ssl" label="SSL" onChange={this.handleSSLChange} /> <Checkbox name="tls" label="SSL" onChange={this.handleSSLChange} />
</div> </div>
{touched.host && <Error>{errors.host}</Error>} {touched.host && <Error>{errors.host}</Error>}
{touched.port && <Error>{errors.port}</Error>} {touched.port && <Error>{errors.port}</Error>}
@ -119,7 +119,7 @@ export default withFormik({
username: '', username: '',
password: defaults.password ? ' ' : '', password: defaults.password ? ' ' : '',
realname: '', realname: '',
ssl: defaults.ssl tls: defaults.ssl
}; };
}, },
validate: values => { validate: values => {
@ -138,7 +138,7 @@ export default withFormik({
} }
if (!values.port) { if (!values.port) {
values.port = values.ssl ? '6697' : '6667'; values.port = values.tls ? '6697' : '6667';
} else if (!isInt(values.port, 1, 65535)) { } else if (!isInt(values.port, 1, 65535)) {
errors.port = 'Invalid port'; errors.port = 'Invalid port';
} }