Skip to content

Commit 085efc3

Browse files
committed
chore: remove legacy compatibility code
1 parent c29a94d commit 085efc3

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

frontend/src/utils/generator.ts

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -272,52 +272,7 @@ const generateDns = (
272272
}
273273

274274
const _adaptToStableBranch = (config: Recordable) => {
275-
config.outbounds.push(
276-
{
277-
type: 'direct',
278-
tag: 'direct',
279-
},
280-
{
281-
type: 'dns',
282-
tag: 'dns-out',
283-
},
284-
{
285-
type: 'block',
286-
tag: 'block',
287-
},
288-
)
289-
config.route.rules = config.route.rules.flatMap((rule: any) => {
290-
if (rule.action === RuleAction.Sniff) {
291-
if (rule.inbound) {
292-
const inbound = config.inbounds.find((v: any) => v.tag === rule.inbound)
293-
if (inbound) {
294-
inbound.sniff = true
295-
}
296-
}
297-
return []
298-
} else if (rule.action === RuleAction.Resolve) {
299-
if (rule.inbound) {
300-
const inbound = config.inbounds.find((v: any) => v.tag === rule.inbound)
301-
if (inbound) {
302-
inbound.domain_strategy = rule.strategy
303-
}
304-
}
305-
return []
306-
} else if (rule.action === RuleAction.Reject) {
307-
rule.outbound = 'block'
308-
} else if (rule.action === RuleAction.HijackDNS) {
309-
rule.outbound = 'dns-out'
310-
}
311-
rule.action = undefined
312-
return rule
313-
})
314-
315-
config.dns.rules.forEach((rule: any) => {
316-
if (rule.action === RuleAction.Reject) {
317-
rule.outbound = 'block'
318-
}
319-
rule.action = undefined
320-
})
275+
config
321276
}
322277

323278
export const generateConfig = async (originalProfile: IProfile, adaptToStableCore?: boolean) => {

0 commit comments

Comments
 (0)