forked from shadowfacts/Tusker
Disallow opening universal links from Open in Safari context menu action
This commit is contained in:
parent
af300a3559
commit
090746f292
|
@ -185,7 +185,7 @@ extension MenuPreviewProvider {
|
|||
|
||||
private func openInSafariAction(url: URL) -> UIAction {
|
||||
return createAction(identifier: "openinsafari", title: "Open in Safari", systemImageName: "safari", handler: { (_) in
|
||||
self.navigationDelegate?.selected(url: url)
|
||||
self.navigationDelegate?.selected(url: url, allowUniversalLinks: false)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ extension TuskerNavigationDelegate {
|
|||
show(HashtagTimelineViewController(for: tag, mastodonController: apiController), sender: self)
|
||||
}
|
||||
|
||||
func selected(url: URL) {
|
||||
func selected(url: URL, allowUniversalLinks: Bool = true) {
|
||||
func openSafari() {
|
||||
if Preferences.shared.useInAppSafari {
|
||||
let config = SFSafariViewController.Configuration()
|
||||
|
@ -53,7 +53,7 @@ extension TuskerNavigationDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
if (Preferences.shared.openLinksInApps) {
|
||||
if allowUniversalLinks && Preferences.shared.openLinksInApps {
|
||||
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { (success) in
|
||||
if (!success) {
|
||||
openSafari()
|
||||
|
|
Loading…
Reference in New Issue