2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/18227: Also update icon on search engine edit.

This commit is contained in:
mcarare 2021-03-01 18:25:26 +02:00 committed by Mihai Adrian Carare
parent fad5a1e757
commit 9dbe4620d4

View File

@ -22,6 +22,7 @@ import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import mozilla.components.browser.icons.IconRequest
import mozilla.components.browser.state.search.SearchEngine
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.HomeActivity
@ -118,7 +119,8 @@ class EditCustomSearchEngineFragment : Fragment(R.layout.fragment_add_search_eng
SearchStringValidator.Result.Success -> {
val update = searchEngine.copy(
name = name,
resultUrls = listOf(searchString.toSearchUrl())
resultUrls = listOf(searchString.toSearchUrl()),
icon = requireComponents.core.icons.loadIcon(IconRequest(searchString)).await().bitmap
)
requireComponents.useCases.searchUseCases.addSearchEngine(update)