[fenix] Fix logic so `isFirstRun` can be called multiple times on first run

pull/600/head
Travis Long 3 years ago committed by mergify[bot]
parent b4886fe546
commit 023612b87d

@ -352,23 +352,17 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false
)
val isFirstRun: Boolean
get() {
val isFirstRun = preferences.getBoolean(
appContext.getPreferenceKey(R.string.pref_key_is_first_run),
true
)
if (isFirstRun) {
val isFirstRun: Boolean =
if (!preferences.contains(appContext.getPreferenceKey(R.string.pref_key_is_first_run))) {
preferences.edit()
.putBoolean(
appContext.getPreferenceKey(R.string.pref_key_is_first_run),
false
)
.apply()
}
return isFirstRun
true
} else {
false
}
/**

Loading…
Cancel
Save