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:
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) {
|
||||
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
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user