Kaynağa Gözat

fix: a little

MystiPanda 1 yıl önce
ebeveyn
işleme
7c254c9b45

+ 12 - 0
src/components/setting/mods/clash-port-viewer.tsx

@@ -56,11 +56,23 @@ export const ClashPortViewer = forwardRef<DialogRef>((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 });