For 19804:Fixed call order in the

This commit is contained in:
Marc Leclair 2021-06-21 17:08:16 -04:00 committed by mergify[bot]
parent b8bbdb45bc
commit db01fab8a9
1 changed files with 4 additions and 3 deletions

View File

@ -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
}
/**