fix: remove rule condition where is not required

This commit is contained in:
dongchengjie 2024-07-03 17:03:12 +08:00
parent 8ff2d687e4
commit 19e9e9d032

View File

@ -355,9 +355,10 @@ export const RulesEditorViewer = (props: Props) => {
throw new Error(t("Invalid Rule"));
}
return `${ruleType.name}${
ruleContent ? "," + ruleContent : ""
},${proxyPolicy}${ruleType.noResolve && noResolve ? ",no-resolve" : ""}`;
const condition = ruleType.required ?? true ? ruleContent : "";
return `${ruleType.name}${condition ? "," + condition : ""},${proxyPolicy}${
ruleType.noResolve && noResolve ? ",no-resolve" : ""
}`;
};
const handleSave = useLockFn(async () => {