MystiPanda 1 éve
szülő
commit
7c254c9b45
1 módosított fájl, 12 hozzáadás és 0 törlés
  1. 12 0
      src/components/setting/mods/clash-port-viewer.tsx

+ 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 });