Skip to content
This repository has been archived by the owner. It is now read-only.

[IP-618] [Search] Onboarding for existing users #397

Merged
merged 7 commits into from Jul 22, 2019
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

fixed search query

  • Loading branch information
Pavel
Pavel committed Jul 22, 2019
commit 417835fa332cd49d13ef36732641bf97d2e4da9e
@@ -915,16 +915,17 @@ class BrowserViewController: UIViewController {
searchController!.didMove(toParentViewController: self)
*/
if (searchController != nil && SettingsPrefs.shared.getCliqzSearchPref() == false) ||
(cliqzSearchController != nil && SettingsPrefs.shared.getCliqzSearchPref() == true){
let shouldShowCliqzSearch = SettingsPrefs.shared.getCliqzSearchPref() || UserPreferences.instance.showSearchOnboarding
if (searchController != nil && !shouldShowCliqzSearch) ||
(cliqzSearchController != nil && shouldShowCliqzSearch){
return
}

searchLoader = SearchLoader(profile: profile, urlBar: urlBar)
searchLoader!.addListener(HistoryListener.shared)

// TODO:PK add telemetry
if SettingsPrefs.shared.getCliqzSearchPref() || UserPreferences.instance.showSearchOnboarding {
if shouldShowCliqzSearch {
homePanelController?.view?.isHidden = true

cliqzSearchController = CliqzSearchViewController(profile: self.profile)
@@ -1682,15 +1683,19 @@ extension BrowserViewController: URLBarDelegate {
searchController?.searchQuery = text
searchLoader?.query = text
*/
if !text.isEmpty {
cliqzSearchController?.searchQuery = text
searchController?.searchQuery = text
searchLoader?.query = text
}
self.updateSearchQuery(query: text)
// End Cliqz
}
}

func updateSearchQuery(query: String) {
if !query.isEmpty {
cliqzSearchController?.searchQuery = query
searchController?.searchQuery = query
searchLoader?.query = query
}
}

func urlBar(_ urlBar: URLBarView, didSubmitText text: String) {
guard let currentTab = tabManager.selectedTab else { return }
if let fixupURL = URIFixup.getURL(text) {
@@ -25,7 +25,11 @@ extension BrowserViewController: SearchViewDelegate {
}

func closeSearchOnboarding() {
let query = cliqzSearchController?.searchQuery
hideSearchController()
showSearchController()
if let query = query {
updateSearchQuery(query: query)
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.