Skip to content

Commit 59bff23

Browse files
committed
Revert "Use in-app browser for Hub vault sharing"
This reverts commit 2e65a3f.
1 parent 2e65a3f commit 59bff23

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

Cryptomator/VaultDetail/ShareVault/ShareVaultCoordinator.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import CryptomatorCloudAccessCore
1010
import CryptomatorCommonCore
11-
import SafariServices
1211
import UIKit
1312

1413
class 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"),

Cryptomator/VaultDetail/ShareVault/ShareVaultView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212

1313
struct 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)

Cryptomator/VaultDetail/ShareVault/ShareVaultViewController.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import UIKit
1919
class 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)

0 commit comments

Comments
 (0)