mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-10 19:50:28 +08:00
fix: handle empty port input by treating it as 0
This commit is contained in:
parent
3097019e9e
commit
7634177c5c
@ -707,8 +707,8 @@ const Mihomo: React.FC = () => {
|
|||||||
max={65535}
|
max={65535}
|
||||||
min={0}
|
min={0}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
const port = parseInt(v)
|
const port = v === '' ? 0 : parseInt(v)
|
||||||
if (!isNaN(port)) {
|
if (!isNaN(port) && port >= 0 && port <= 65535) {
|
||||||
setMixedPortInput(port)
|
setMixedPortInput(port)
|
||||||
patchAppConfig({ showMixedPort: port })
|
patchAppConfig({ showMixedPort: port })
|
||||||
setIsManualPortChange(true)
|
setIsManualPortChange(true)
|
||||||
@ -768,8 +768,8 @@ const Mihomo: React.FC = () => {
|
|||||||
max={65535}
|
max={65535}
|
||||||
min={0}
|
min={0}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
const port = parseInt(v)
|
const port = v === '' ? 0 : parseInt(v)
|
||||||
if (!isNaN(port)) {
|
if (!isNaN(port) && port >= 0 && port <= 65535) {
|
||||||
setSocksPortInput(port)
|
setSocksPortInput(port)
|
||||||
patchAppConfig({ showSocksPort: port })
|
patchAppConfig({ showSocksPort: port })
|
||||||
setIsManualPortChange(true)
|
setIsManualPortChange(true)
|
||||||
@ -829,8 +829,8 @@ const Mihomo: React.FC = () => {
|
|||||||
max={65535}
|
max={65535}
|
||||||
min={0}
|
min={0}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
const port = parseInt(v)
|
const port = v === '' ? 0 : parseInt(v)
|
||||||
if (!isNaN(port)) {
|
if (!isNaN(port) && port >= 0 && port <= 65535) {
|
||||||
setHttpPortInput(port)
|
setHttpPortInput(port)
|
||||||
patchAppConfig({ showHttpPort: port })
|
patchAppConfig({ showHttpPort: port })
|
||||||
setIsManualPortChange(true)
|
setIsManualPortChange(true)
|
||||||
@ -891,8 +891,8 @@ const Mihomo: React.FC = () => {
|
|||||||
max={65535}
|
max={65535}
|
||||||
min={0}
|
min={0}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
const port = parseInt(v)
|
const port = v === '' ? 0 : parseInt(v)
|
||||||
if (!isNaN(port)) {
|
if (!isNaN(port) && port >= 0 && port <= 65535) {
|
||||||
setRedirPortInput(port)
|
setRedirPortInput(port)
|
||||||
patchAppConfig({ showRedirPort: port })
|
patchAppConfig({ showRedirPort: port })
|
||||||
setIsManualPortChange(true)
|
setIsManualPortChange(true)
|
||||||
@ -954,8 +954,8 @@ const Mihomo: React.FC = () => {
|
|||||||
max={65535}
|
max={65535}
|
||||||
min={0}
|
min={0}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
const port = parseInt(v)
|
const port = v === '' ? 0 : parseInt(v)
|
||||||
if (!isNaN(port)) {
|
if (!isNaN(port) && port >= 0 && port <= 65535) {
|
||||||
setTproxyPortInput(port)
|
setTproxyPortInput(port)
|
||||||
patchAppConfig({ showTproxyPort: port })
|
patchAppConfig({ showTproxyPort: port })
|
||||||
setIsManualPortChange(true)
|
setIsManualPortChange(true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user