File tree Expand file tree Collapse file tree 3 files changed +3
-22
lines changed
Cryptomator/VaultDetail/ShareVault Expand file tree Collapse file tree 3 files changed +3
-22
lines changed Original file line number Diff line number Diff line change 88
99import CryptomatorCloudAccessCore
1010import CryptomatorCommonCore
11- import SafariServices
1211import UIKit
1312
1413class ShareVaultCoordinator : Coordinator {
@@ -37,25 +36,9 @@ class ShareVaultCoordinator: Coordinator {
3736
3837 let shareVaultViewController = ShareVaultViewController ( viewModel: viewModel)
3938 shareVaultViewController. coordinator = self
40- shareVaultViewController. onOpenURL = { [ weak self] url in
41- self ? . openURL ( url)
42- }
4339 navigationController. pushViewController ( shareVaultViewController, animated: true )
4440 }
4541
46- private func openURL( _ url: URL ) {
47- if vaultInfo. vaultConfigType == . hub {
48- openInAppBrowser ( url: url)
49- } else {
50- UIApplication . shared. open ( url)
51- }
52- }
53-
54- private func openInAppBrowser( url: URL ) {
55- let safariViewController = SFSafariViewController ( url: url)
56- navigationController. present ( safariViewController, animated: true )
57- }
58-
5942 private func showHubURLExtractionError( ) {
6043 let alert = UIAlertController (
6144 title: LocalizedString . getValue ( " shareVault.error.hubURLExtraction.title " ) ,
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import UIKit
1212
1313struct ShareVaultView : View {
1414 @ObservedObject var viewModel : ShareVaultViewModel
15- var onOpenURL : ( ( URL ) -> Void ) ?
1615
1716 var body : some View {
1817 ZStack {
@@ -96,7 +95,7 @@ struct ShareVaultView: View {
9695 . font ( . footnote)
9796 . multilineTextAlignment ( . center)
9897 . onTapGesture {
99- onOpenURL ? ( docsURL)
98+ UIApplication . shared . open ( docsURL)
10099 }
101100 }
102101 . padding ( . top, 32 )
@@ -112,7 +111,7 @@ struct ShareVaultView: View {
112111 if let url = viewModel. forTeamsURL {
113112 Button (
114113 action: {
115- onOpenURL ? ( url)
114+ UIApplication . shared . open ( url)
116115 } ,
117116 label: {
118117 Text ( viewModel. forTeamsButtonTitle)
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import UIKit
1919class ShareVaultViewController : UIViewController {
2020 weak var coordinator : ShareVaultCoordinator ?
2121 private let viewModel : ShareVaultViewModel
22- var onOpenURL : ( ( URL ) -> Void ) ?
2322
2423 init ( viewModel: ShareVaultViewModel ) {
2524 self . viewModel = viewModel
@@ -38,7 +37,7 @@ class ShareVaultViewController: UIViewController {
3837 }
3938
4039 private func setupSwiftUIView( ) {
41- let child = UIHostingController ( rootView: ShareVaultView ( viewModel: viewModel, onOpenURL : onOpenURL ) )
40+ let child = UIHostingController ( rootView: ShareVaultView ( viewModel: viewModel) )
4241 addChild ( child)
4342 view. addSubview ( child. view)
4443 child. didMove ( toParent: self )
You can’t perform that action at this time.
0 commit comments