Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #3821 - Added Recent-Search from Search Engine Suggestions. (#3822)
Browse files Browse the repository at this point in the history
* Added Recent-Search from Search Engine Suggestions.
  • Loading branch information
Brandon-T authored and iccub committed Jun 18, 2021
1 parent 5a76d90 commit 48cad66
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Client/Frontend/Browser/Search/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ class SearchViewController: SiteTableViewController, LoaderListener {

switch section {
case .quickBar:
if !PrivateBrowsingManager.shared.isPrivateBrowsing {
RecentSearch.addItem(type: .text, text: searchQuery, websiteUrl: nil)
}
searchDelegate?.searchViewController(self, didSubmit: searchQuery)
case .searchSuggestionsOptIn: return
case .searchSuggestions:
Expand All @@ -433,6 +436,9 @@ class SearchViewController: SiteTableViewController, LoaderListener {
}

if let url = url {
if !PrivateBrowsingManager.shared.isPrivateBrowsing {
RecentSearch.addItem(type: .website, text: suggestion, websiteUrl: url.absoluteString)
}
searchDelegate?.searchViewController(self, didSelectURL: url)
}
case .bookmarksAndHistory:
Expand Down

0 comments on commit 48cad66

Please # to comment.