fix: let SettingForm skip saving DNS value when UseCustomDNS is not enabled

This commit is contained in:
ChsBuffer
2020-11-29 16:10:23 +08:00
parent 1eebb61d04
commit 639fcf9575

View File

@@ -120,7 +120,11 @@ namespace Netch.Forms
BindTextBox(TUNTAPDNSTextBox,
s => !UseCustomDNSCheckBox.Checked || DNS.TrySplit(s, out _, 2),
s => Global.Settings.TUNTAP.DNS = DNS.Split(s).ToList(),
s =>
{
if (UseCustomDNSCheckBox.Checked)
Global.Settings.TUNTAP.DNS = DNS.Split(s).ToList();
},
DNS.Join(Global.Settings.TUNTAP.DNS));
BindCheckBox(ProxyDNSCheckBox,