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

[fenix] update isFirstRun to be manually set and set experiments locally on first run

This commit is contained in:
Charlie Humphreys 2022-08-09 15:23:40 -05:00 committed by mergify[bot]
parent 4f6fdb648f
commit 028c519532
2 changed files with 6 additions and 13 deletions

View File

@ -101,7 +101,8 @@ fun createNimbus(context: Context, url: String?): NimbusApi {
globalUserParticipation = enabled
}
if (url.isNullOrBlank()) {
if (context.settings().isFirstRun || url.isNullOrBlank()) {
context.settings().isFirstRun = false
setExperimentsLocally(R.raw.initial_experiments)
}

View File

@ -347,18 +347,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false
)
val isFirstRun: Boolean =
if (!preferences.contains(appContext.getPreferenceKey(R.string.pref_key_is_first_run))) {
preferences.edit()
.putBoolean(
val isFirstRun: Boolean by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_is_first_run),
false
default = true
)
.apply()
true
} else {
false
}
/**
* Indicates the last time when the user was interacting with the [BrowserFragment],