Merge pull request #60 from kkk669/issues/59

Fix the issue that Do*Sections has wrong servers
This commit is contained in:
Kenta Kubo 2023-03-06 00:21:35 +09:00 committed by GitHub
commit 70ae78bfea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -97,6 +97,14 @@ extension DoHSections: View {
self.commit()
}
}
.onChange(of: self.server) { server in
switch server.configuration {
case .dnsOverTLS:
preconditionFailure("unreachable")
case .dnsOverHTTPS(let configuration):
self.configuration = configuration
}
}
.onDisappear {
self.commit()
}

View file

@ -94,6 +94,14 @@ extension DoTSections: View {
self.commit()
}
}
.onChange(of: self.server) { server in
switch server.configuration {
case .dnsOverTLS(let configuration):
self.configuration = configuration
case .dnsOverHTTPS:
preconditionFailure("unreachable")
}
}
.onDisappear {
self.commit()
}