Make sure the connect form port is always a string
This commit is contained in:
parent
4ac0dd7c4b
commit
d27d108a07
File diff suppressed because one or more lines are too long
@ -102,17 +102,26 @@ class Connect extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default withFormik({
|
export default withFormik({
|
||||||
mapPropsToValues: ({ defaults }) => ({
|
mapPropsToValues: ({ defaults }) => {
|
||||||
name: defaults.name,
|
let port = '6667';
|
||||||
host: defaults.host,
|
if (defaults.port) {
|
||||||
port: defaults.port || (defaults.ssl ? '6697' : '6667'),
|
port = `${defaults.port}`;
|
||||||
nick: '',
|
} else if (defaults.ssl) {
|
||||||
channels: defaults.channels.join(','),
|
port = '6697';
|
||||||
username: '',
|
}
|
||||||
password: defaults.password ? ' ' : '',
|
|
||||||
realname: '',
|
return {
|
||||||
ssl: defaults.ssl
|
name: defaults.name,
|
||||||
}),
|
host: defaults.host,
|
||||||
|
port,
|
||||||
|
nick: '',
|
||||||
|
channels: defaults.channels.join(','),
|
||||||
|
username: '',
|
||||||
|
password: defaults.password ? ' ' : '',
|
||||||
|
realname: '',
|
||||||
|
ssl: defaults.ssl
|
||||||
|
};
|
||||||
|
},
|
||||||
validate: values => {
|
validate: values => {
|
||||||
Object.keys(values).forEach(k => {
|
Object.keys(values).forEach(k => {
|
||||||
if (typeof values[k] === 'string') {
|
if (typeof values[k] === 'string') {
|
||||||
|
Loading…
Reference in New Issue
Block a user