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

Commit

Permalink
Ref #4221: Set correct preference value for BraveSearch default.
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub committed Oct 13, 2021
1 parent 40f1a37 commit af03ba8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Client/Frontend/Browser/Search/InitialSearchEngines.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ class InitialSearchEngines {
}
}

/// Due to legacy reasons, the search engine name may need to use an old value.
/// This is caused because we use 'display name' as a preference key.
var legacyName: String? {
switch self {
case .braveSearch: return "Brave Search beta"
default: return nil
}
}

func excludedFromOnboarding(for locale: Locale) -> Bool {
switch self {
case .braveSearch: return true
Expand Down
3 changes: 2 additions & 1 deletion Client/Frontend/Browser/Search/SearchEngines.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class SearchEngines {
}

func searchEngineSetup() {
setInitialDefaultEngine(initialSearchEngines.defaultSearchEngine.rawValue)
let engine = initialSearchEngines.defaultSearchEngine
setInitialDefaultEngine(engine.legacyName ?? engine.rawValue)
}

/// If no engine type is specified this method returns search engine for regular browsing.
Expand Down

0 comments on commit af03ba8

Please sign in to comment.