[fenix] For 19804:Fixed call order in the

pull/600/head
Marc Leclair 3 years ago committed by mergify[bot]
parent 6e811abdef
commit 6c2115cf4a

@ -476,9 +476,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
fun checkDefaultBrowserAndSet(): Boolean {
val prefKey = appContext.getPreferenceKey(R.string.pref_key_default_browser)
val isDefaultBrowser = isDefaultBrowser()
this.preferences.edit().putBoolean(prefKey, isDefaultBrowser).apply()
return this.preferences.getBoolean(prefKey, isDefaultBrowser) != isDefaultBrowser
val isDefaultBrowserNow = isDefaultBrowser()
val isDefaultBrowserBefore = this.preferences.getBoolean(prefKey, isDefaultBrowserNow)
this.preferences.edit().putBoolean(prefKey, isDefaultBrowserNow).apply()
return isDefaultBrowserNow != isDefaultBrowserBefore
}
/**

Loading…
Cancel
Save