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

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

This commit is contained in:
Travis Long 2021-08-19 11:21:48 -05:00 committed by mergify[bot]
parent b4886fe546
commit 023612b87d

View File

@ -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) {
preferences.edit()
.putBoolean(
appContext.getPreferenceKey(R.string.pref_key_is_first_run),
false
)
.apply()
}
return 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()
true
} else {
false
}
/**