fix: a little

This commit is contained in:
MystiPanda 2024-03-21 11:43:16 +08:00
parent b1c458359d
commit 7c254c9b45
No known key found for this signature in database
GPG Key ID: 47D0F0284DC57888

View File

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