mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] Use new async API to load and access search engines
Use the new asynchronous features of the search engine manager from a-c to avoid the latency required to load the default search engine.
This commit is contained in:
parent
dd5ec5b640
commit
2127d42c9d
@ -31,12 +31,11 @@ class Search(private val context: Context) {
|
||||
).apply {
|
||||
registerForLocaleUpdates(context)
|
||||
GlobalScope.launch {
|
||||
loadAsync(context).await()
|
||||
defaultSearchEngine = getDefaultSearchEngineAsync(
|
||||
context,
|
||||
Settings.getInstance(context).defaultSearchEngineName
|
||||
)
|
||||
}
|
||||
defaultSearchEngine = getDefaultSearchEngine(
|
||||
context,
|
||||
Settings.getInstance(context).defaultSearchEngineName
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,9 +152,8 @@ class AwesomeBarView(
|
||||
|
||||
defaultSearchSuggestionProvider =
|
||||
SearchSuggestionProvider(
|
||||
searchEngine = components.search.searchEngineManager.getDefaultSearchEngine(
|
||||
this
|
||||
),
|
||||
context = this,
|
||||
searchEngineManager = components.search.searchEngineManager,
|
||||
searchUseCase = searchUseCase,
|
||||
fetchClient = components.core.client,
|
||||
mode = SearchSuggestionProvider.Mode.MULTIPLE_SUGGESTIONS,
|
||||
|
Loading…
Reference in New Issue
Block a user