Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixed ome search results not opening issue (#415)
- Loading branch information
Showing
with
14 additions
and
1 deletion.
-
+14
−1
Cliqz/Search/CliqzSearchViewController.swift
|
|
@@ -251,7 +251,20 @@ class CliqzSearchViewController : UIViewController, KeyboardHelperDelegate, UIAl |
|
extension CliqzSearchViewController {
|
|
extension CliqzSearchViewController {
|
|
|
|
|
|
@objc func didSelectUrl(_ notification: Notification) {
|
|
@objc func didSelectUrl(_ notification: Notification) {
|
|
if let url_str = notification.object as? NSString, let url = URL(string: url_str as String) {
|
|
// ReactNative is not sending encoded URL always, so for that we should have fall back mechanism
|
|
|
|
guard let url_str = notification.object as? String else {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var url: URL?
|
|
|
|
|
|
|
|
if let selectedUrl = URL(string: url_str) {
|
|
|
|
url = selectedUrl
|
|
|
|
} else if let encodedString = url_str.addingPercentEncoding(
|
|
|
|
withAllowedCharacters: NSCharacterSet.urlFragmentAllowed) {
|
|
|
|
url = URL(string: encodedString)
|
|
|
|
}
|
|
|
|
|
|
|
|
if let url = url {
|
|
#if PAID
|
|
#if PAID
|
|
let isSearchEngine = notification.userInfo?[OpenURLIsSearchEngineKey] as? Bool
|
|
let isSearchEngine = notification.userInfo?[OpenURLIsSearchEngineKey] as? Bool
|
|
if UserPreferences.instance.shouldShowNonPrivateSearchWarningMessage, isSearchEngine ?? false {
|
|
if UserPreferences.instance.shouldShowNonPrivateSearchWarningMessage, isSearchEngine ?? false {
|
|
|
|