diff --git a/Tusker/Screens/Utilities/Previewing.swift b/Tusker/Screens/Utilities/Previewing.swift index 6b7ff8c7d7..0e7f7cb994 100644 --- a/Tusker/Screens/Utilities/Previewing.swift +++ b/Tusker/Screens/Utilities/Previewing.swift @@ -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) }) } diff --git a/Tusker/TuskerNavigationDelegate.swift b/Tusker/TuskerNavigationDelegate.swift index 47efa68617..d03425c98b 100644 --- a/Tusker/TuskerNavigationDelegate.swift +++ b/Tusker/TuskerNavigationDelegate.swift @@ -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()