mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Add https if there's no prefix (IOS-141)
This commit is contained in:
parent
5cb1280088
commit
fa6b3fed24
@ -282,8 +282,20 @@ class SearchResultsOverviewTableViewController: UIViewController, NeedsDependenc
|
||||
target: .status, // remove reblog wrapper
|
||||
status: status.asRecord
|
||||
)
|
||||
} else if let url = URL(string: link) {
|
||||
coordinator.present(scene: .safari(url: url), transition: .safariPresent(animated: true))
|
||||
} else if var url = URL(string: link) {
|
||||
let prefixedURL: URL?
|
||||
if var components = URLComponents(url: url, resolvingAgainstBaseURL: false) {
|
||||
if components.scheme == nil {
|
||||
components.scheme = "https"
|
||||
}
|
||||
prefixedURL = components.url
|
||||
} else {
|
||||
prefixedURL = url
|
||||
}
|
||||
|
||||
guard let prefixedURL else { return }
|
||||
|
||||
coordinator.present(scene: .safari(url: prefixedURL), transition: .safariPresent(animated: true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user