From 3047ff690da3acb0832d9f58b895b89076bb7aff Mon Sep 17 00:00:00 2001 From: Kenta Kubo <601636+kkk669@users.noreply.github.com> Date: Fri, 23 Sep 2022 03:12:47 +0900 Subject: [PATCH] Fix the issue that saving configuration doesn't work --- DNSecure/Views/DetailView.swift | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DNSecure/Views/DetailView.swift b/DNSecure/Views/DetailView.swift index 6fd1259..d33a3b1 100644 --- a/DNSecure/Views/DetailView.swift +++ b/DNSecure/Views/DetailView.swift @@ -69,18 +69,8 @@ extension DetailView: View { switch self.server.configuration { case .dnsOverTLS(let configuration): self.dnsOverTLSSections(configuration) - .onChange(of: self.focusedField) { newValue in - if newValue == nil { - self.server.configuration = .dnsOverTLS(configuration) - } - } case .dnsOverHTTPS(let configuration): self.dnsOverHTTPSSections(configuration) - .onChange(of: self.focusedField) { newValue in - if newValue == nil { - self.server.configuration = .dnsOverHTTPS(configuration) - } - } } } @@ -156,6 +146,11 @@ extension DetailView: View { } footer: { Text("The TLS name of a DNS-over-TLS server.") } + .onChange(of: self.focusedField) { newValue in + if newValue == nil { + self.server.configuration = .dnsOverTLS(configuration) + } + } } @ViewBuilder @@ -231,6 +226,11 @@ extension DetailView: View { } footer: { Text("The URL of a DNS-over-HTTPS server.") } + .onChange(of: self.focusedField) { newValue in + if newValue == nil { + self.server.configuration = .dnsOverHTTPS(configuration) + } + } } }