aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/AppDelegate.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/AppDelegate.swift')
-rw-r--r--WireGuard/AppDelegate.swift26
1 files changed, 18 insertions, 8 deletions
diff --git a/WireGuard/AppDelegate.swift b/WireGuard/AppDelegate.swift
index 2460a9f..bf9573e 100644
--- a/WireGuard/AppDelegate.swift
+++ b/WireGuard/AppDelegate.swift
@@ -32,14 +32,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
os_log("Failed to remove item from Inbox: %{public}@", log: Log.general, type: .error, url.absoluteString)
}
}
- guard url.pathExtension == "conf" else { return false }
-
- do {
- try appCoordinator.importConfig(config: url)
- } catch {
- os_log("Unable to import config: %{public}@", log: Log.general, type: .error, url.absoluteString)
- return false
+ if url.pathExtension == "conf" {
+ do {
+ try appCoordinator.importConfig(config: url)
+ } catch {
+ os_log("Unable to import config: %{public}@", log: Log.general, type: .error, url.absoluteString)
+ return false
+ }
+ return true
+ } else if url.pathExtension == "zip" {
+ do {
+ try appCoordinator.importConfigs(configZip: url)
+ } catch {
+ os_log("Unable to import config: %{public}@", log: Log.general, type: .error, url.absoluteString)
+ return false
+ }
+ return true
}
- return true
+ return false
+
}
}