This commit is contained in:
Alireza Ahmadi
2024-10-22 22:20:44 +02:00
parent 5105c138f7
commit 90b2876867
+1 -1
View File
@@ -247,7 +247,7 @@ export default {
this.subJsonExt.rules.unshift({ protocol: "dns", outbound: "dns-out" }) this.subJsonExt.rules.unshift({ protocol: "dns", outbound: "dns-out" })
} else { } else {
delete this.subJsonExt.dns delete this.subJsonExt.dns
const ruleDnsIndex = this.subJsonExt?.rules?.findIndex((r:any) => r.protocol = "dns" && r.outbound == "dns-out") const ruleDnsIndex = this.subJsonExt?.rules?.findIndex((r:any) => r.protocol == "dns" && r.outbound == "dns-out")
if (ruleDnsIndex >= 0) this.subJsonExt.rules.splice(ruleDnsIndex,1) if (ruleDnsIndex >= 0) this.subJsonExt.rules.splice(ruleDnsIndex,1)
if (this.rules.length == 0) delete this.subJsonExt.rules if (this.rules.length == 0) delete this.subJsonExt.rules
} }