Fix: display NaN when input is empty (#36)

Co-authored-by: kangyuantong <gongyu@gaoding.com>
This commit is contained in:
SonicKang 2020-06-03 15:29:17 +08:00 committed by GitHub
parent e8bf3e4df6
commit 9f95b2d83a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,7 +155,7 @@ export default function Settings () {
<Col span={8}> <Col span={8}>
<Input <Input
value={info.socks5ProxyPort} value={info.socks5ProxyPort}
onChange={socks5ProxyPort => set('socks5ProxyPort', parseInt(socks5ProxyPort, 10))} onChange={socks5ProxyPort => set('socks5ProxyPort', +socks5ProxyPort)}
onBlur={handleSocksPortSave} onBlur={handleSocksPortSave}
/> />
</Col> </Col>
@ -169,7 +169,7 @@ export default function Settings () {
<Col span={8}> <Col span={8}>
<Input <Input
value={info.httpProxyPort} value={info.httpProxyPort}
onChange={httpProxyPort => set('httpProxyPort', parseInt(httpProxyPort, 10))} onChange={httpProxyPort => set('httpProxyPort', +httpProxyPort)}
onBlur={handleHttpPortSave} onBlur={handleHttpPortSave}
/> />
</Col> </Col>