mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 17:50:59 +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):
|
||||
navigate(toNotification: notificationService.notification)
|
||||
case let .url(url):
|
||||
if viewModel.identityContext.appPreferences.useUniversalLinks {
|
||||
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { success in
|
||||
if !success {
|
||||
self.open(url: url)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
open(url: url)
|
||||
}
|
||||
case .searchScope:
|
||||
break
|
||||
case .webfingerStart:
|
||||
|
@ -458,6 +450,7 @@ private extension TableViewController {
|
|||
}
|
||||
|
||||
func open(url: URL) {
|
||||
func openWithRegardToBrowserSetting(url: URL) {
|
||||
if viewModel.identityContext.appPreferences.openLinksInDefaultBrowser {
|
||||
UIApplication.shared.open(url)
|
||||
} else {
|
||||
|
@ -465,6 +458,17 @@ private extension TableViewController {
|
|||
}
|
||||
}
|
||||
|
||||
if viewModel.identityContext.appPreferences.useUniversalLinks {
|
||||
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { success in
|
||||
if !success {
|
||||
openWithRegardToBrowserSetting(url: url)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
openWithRegardToBrowserSetting(url: url)
|
||||
}
|
||||
}
|
||||
|
||||
func present(attachmentViewModel: AttachmentViewModel, statusViewModel: StatusViewModel) {
|
||||
switch attachmentViewModel.attachment.type {
|
||||
case .audio, .video:
|
||||
|
|
Loading…
Reference in a new issue