Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #27753 - Update search engines immediately after changing system …
Browse files Browse the repository at this point in the history
…language
  • Loading branch information
DreVla authored and mergify[bot] committed Dec 6, 2022
1 parent 807b056 commit 80a1708
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import mozilla.appservices.places.BookmarkRoot
import mozilla.components.browser.state.action.ContentAction
import mozilla.components.browser.state.action.SearchAction
import mozilla.components.browser.state.search.SearchEngine
import mozilla.components.browser.state.selector.getNormalOrPrivateTabs
import mozilla.components.browser.state.state.SessionState
Expand Down Expand Up @@ -384,6 +385,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
DefaultBrowserNotificationWorker.setDefaultBrowserNotificationIfNeeded(applicationContext)
ReEngagementNotificationWorker.setReEngagementNotificationIfNeeded(applicationContext)
}

// This was done in order to refresh search engines when app is running in background
// and the user changes the system language
// More details here: https://github.com/mozilla-mobile/fenix/pull/27793#discussion_r1029892536
components.core.store.dispatch(SearchAction.RefreshSearchEnginesAction)
}

override fun onStart() {
Expand Down

0 comments on commit 80a1708

Please sign in to comment.