From 639fcf957575ba7c2c057c17b49de47ae4840250 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sun, 29 Nov 2020 16:10:23 +0800 Subject: [PATCH] fix: let SettingForm skip saving DNS value when UseCustomDNS is not enabled --- Netch/Forms/SettingForm.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Netch/Forms/SettingForm.cs b/Netch/Forms/SettingForm.cs index 9c44e0a5..a1995cf8 100644 --- a/Netch/Forms/SettingForm.cs +++ b/Netch/Forms/SettingForm.cs @@ -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,