diff options
author | Roopesh Chander <roop@roopc.net> | 2018-12-29 01:36:46 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-01-14 14:52:29 +0530 |
commit | 6a27626fc003399b1f542b7ef64ea838001375dc (patch) | |
tree | 97306ad99b7c4fdd429a464068d3caa457f3e47e /WireGuard/WireGuard/UI/iOS/AppDelegate.swift | |
parent | macOS: Add tunnel management menu items (diff) | |
download | wireguard-apple-6a27626fc003399b1f542b7ef64ea838001375dc.tar.xz wireguard-apple-6a27626fc003399b1f542b7ef64ea838001375dc.zip |
iOS: Refactor importFromFile
So that it can be used in macOS as well
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/AppDelegate.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/AppDelegate.swift | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift index 52c5b0a..c295002 100644 --- a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift +++ b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift @@ -27,7 +27,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { - mainVC?.tunnelsListVC?.importFromFile(url: url) { + guard let tunnelsManager = mainVC?.tunnelsManager else { return true } + TunnelImporter.importFromFile(url: url, into: tunnelsManager, sourceVC: mainVC, errorPresenterType: ErrorPresenter.self) { _ = FileManager.deleteFile(at: url) } return true |