mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
fix: apply DNS hosts only if useHosts is true (#742)
Co-authored-by: 2045gemini <2045gemini@gmail.com>
This commit is contained in:
parent
da5336ee36
commit
27ab6d1b5c
@ -142,9 +142,6 @@ const DNS: React.FC = () => {
|
||||
className="app-nodrag"
|
||||
color="primary"
|
||||
onPress={() => {
|
||||
const hostsObject = Object.fromEntries(
|
||||
values.hosts.map(({ domain, value }) => [domain, value])
|
||||
)
|
||||
const dnsConfig = {
|
||||
ipv6: values.ipv6,
|
||||
'fake-ip-range': values.fakeIPRange,
|
||||
@ -165,10 +162,13 @@ const DNS: React.FC = () => {
|
||||
values.nameserverPolicy.map(({ domain, value }) => [domain, value])
|
||||
)
|
||||
}
|
||||
onSave({
|
||||
dns: dnsConfig,
|
||||
hosts: hostsObject
|
||||
})
|
||||
const result = { dns: dnsConfig }
|
||||
if (values.useHosts) {
|
||||
result['hosts'] = Object.fromEntries(
|
||||
values.hosts.map(({ domain, value }) => [domain, value])
|
||||
)
|
||||
}
|
||||
onSave(result)
|
||||
}}
|
||||
>
|
||||
{t('common.save')}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user