mirror of
https://github.com/metabolist/metatext.git
synced 2025-02-16 14:05:14 +00:00
Refactoring
This commit is contained in:
parent
cb74fd42be
commit
c4abbc764e
1 changed files with 16 additions and 12 deletions
|
@ -228,15 +228,7 @@ extension TableViewController {
|
||||||
case let .notification(notificationService):
|
case let .notification(notificationService):
|
||||||
navigate(toNotification: notificationService.notification)
|
navigate(toNotification: notificationService.notification)
|
||||||
case let .url(url):
|
case let .url(url):
|
||||||
if viewModel.identityContext.appPreferences.useUniversalLinks {
|
open(url: url)
|
||||||
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { success in
|
|
||||||
if !success {
|
|
||||||
self.open(url: url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
open(url: url)
|
|
||||||
}
|
|
||||||
case .searchScope:
|
case .searchScope:
|
||||||
break
|
break
|
||||||
case .webfingerStart:
|
case .webfingerStart:
|
||||||
|
@ -458,10 +450,22 @@ private extension TableViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
func open(url: URL) {
|
func open(url: URL) {
|
||||||
if viewModel.identityContext.appPreferences.openLinksInDefaultBrowser {
|
func openWithRegardToBrowserSetting(url: URL) {
|
||||||
UIApplication.shared.open(url)
|
if viewModel.identityContext.appPreferences.openLinksInDefaultBrowser {
|
||||||
|
UIApplication.shared.open(url)
|
||||||
|
} else {
|
||||||
|
present(SFSafariViewController(url: url), animated: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if viewModel.identityContext.appPreferences.useUniversalLinks {
|
||||||
|
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { success in
|
||||||
|
if !success {
|
||||||
|
openWithRegardToBrowserSetting(url: url)
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
present(SFSafariViewController(url: url), animated: true)
|
openWithRegardToBrowserSetting(url: url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue