From dbd2f697f904b44c1044126ebaceb023e7a3090e Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 21 Mar 2024 11:43:16 +0800 Subject: [PATCH] fix: a little --- src/components/setting/mods/clash-port-viewer.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/setting/mods/clash-port-viewer.tsx b/src/components/setting/mods/clash-port-viewer.tsx index 949cef11..70b1f4b8 100644 --- a/src/components/setting/mods/clash-port-viewer.tsx +++ b/src/components/setting/mods/clash-port-viewer.tsx @@ -56,11 +56,23 @@ export const ClashPortViewer = forwardRef((props, ref) => { } if ( + OS === "linux" && new Set([redirPort, tproxyPort, mixedPort, socksPort, port]).size !== 5 ) { Notice.error("Port conflict!", 4000); return; } + if ( + OS === "macos" && + new Set([redirPort, mixedPort, socksPort, port]).size !== 4 + ) { + Notice.error("Port conflict!", 4000); + return; + } + if (OS === "windows" && new Set([mixedPort, socksPort, port]).size !== 3) { + Notice.error("Port conflict!", 4000); + return; + } try { if (OS !== "windows") { await patchInfo({ "redir-port": redirPort });