mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Converts to a browser preference to a Bool.
This commit is contained in:
@@ -250,11 +250,11 @@ class WebViewController: UIViewController {
|
||||
|
||||
func openInAppBrowser() {
|
||||
guard let url = article?.preferredURL else { return }
|
||||
if AppDefaults.shared.browserPreference == Browser.inApp.browserID {
|
||||
if AppDefaults.shared.useSystemBrowser {
|
||||
UIApplication.shared.open(url, options: [:])
|
||||
} else {
|
||||
let vc = SFSafariViewController(url: url)
|
||||
present(vc, animated: true)
|
||||
} else {
|
||||
UIApplication.shared.open(url, options: [:])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -348,11 +348,11 @@ extension WebViewController: WKNavigationDelegate {
|
||||
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
|
||||
if components?.scheme == "http" || components?.scheme == "https" {
|
||||
decisionHandler(.cancel)
|
||||
if AppDefaults.shared.browserPreference == Browser.inApp.browserID {
|
||||
if AppDefaults.shared.useSystemBrowser {
|
||||
UIApplication.shared.open(url, options: [:])
|
||||
} else {
|
||||
let vc = SFSafariViewController(url: url)
|
||||
self.present(vc, animated: true, completion: nil)
|
||||
} else {
|
||||
UIApplication.shared.open(url, options: [:])
|
||||
}
|
||||
|
||||
} else if components?.scheme == "mailto" {
|
||||
|
||||
Reference in New Issue
Block a user