Ignore "configuration is unchanged" error

Fixes #7
This commit is contained in:
Kenta Kubo 2020-10-16 01:14:49 +09:00
parent d927dc2179
commit aae4848ed6

View file

@ -79,7 +79,11 @@ struct ContentView {
manager.dnsSettings = server.configuration.toDNSSettings()
manager.saveToPreferences { saveError in
self.updateStatus()
if let saveError = saveError {
if let saveError = saveError as NSError? {
guard saveError.domain != "NEConfigurationErrorDomain"
|| saveError.code != 9 else {
return
}
logger.error("\(saveError.localizedDescription)")
self.alert("Save Error", saveError.localizedDescription)
return