diff --git a/ApplicationLibrary/Views/Dashboard/DashboardView.swift b/ApplicationLibrary/Views/Dashboard/DashboardView.swift index c7c851a..b73b056 100644 --- a/ApplicationLibrary/Views/Dashboard/DashboardView.swift +++ b/ApplicationLibrary/Views/Dashboard/DashboardView.swift @@ -165,7 +165,7 @@ public struct DashboardView: View { return } await MainActor.run { - alert = Alert(title: Text("Service Error"), message: Text(message)) + alert = Alert(title: Text("Service Error"), message: Text(message!.value)) } } diff --git a/Library/Database/Profile+Update.swift b/Library/Database/Profile+Update.swift index c64be83..0a1e07c 100644 --- a/Library/Database/Profile+Update.swift +++ b/Library/Database/Profile+Update.swift @@ -24,7 +24,7 @@ public extension Profile { try write(remoteContent) try await onProfileUpdated() } - + nonisolated func onProfileUpdated() async throws { if await SharedPreferences.selectedProfileID.get() == id { if let profile = try? await ExtensionProfile.load() { @@ -34,5 +34,4 @@ public extension Profile { } } } - } diff --git a/Library/Network/ExtensionPlatformInterface.swift b/Library/Network/ExtensionPlatformInterface.swift index 2f315b4..15eeb10 100644 --- a/Library/Network/ExtensionPlatformInterface.swift +++ b/Library/Network/ExtensionPlatformInterface.swift @@ -35,12 +35,8 @@ public class ExtensionPlatformInterface: NSObject, LibboxPlatformInterfaceProtoc if options.getAutoRoute() { settings.mtu = NSNumber(value: options.getMTU()) - var error: NSError? - let dnsServer = options.getDNSServerAddress(&error) - if let error { - throw error - } - let dnsSettings = NEDNSSettings(servers: [dnsServer]) + let dnsServer = try options.getDNSServerAddress() + let dnsSettings = NEDNSSettings(servers: [dnsServer.value]) dnsSettings.matchDomains = [""] dnsSettings.matchDomainsNoSearch = true settings.dnsSettings = dnsSettings diff --git a/Library/Network/HTTPClient.swift b/Library/Network/HTTPClient.swift index 5355b6e..2206c5a 100644 --- a/Library/Network/HTTPClient.swift +++ b/Library/Network/HTTPClient.swift @@ -26,12 +26,8 @@ public class HTTPClient { request.setUserAgent(HTTPClient.userAgent) try request.setURL(url) let response = try request.execute() - var error: NSError? - let contentString = response.getContentString(&error) - if let error { - throw error - } - return contentString + let content = try response.getContent() + return content.value } deinit {