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

pull/543/head
Charlie Humphreys 2 years ago committed by mergify[bot]
parent 9b8ffbc8c1
commit 1ce99506ad

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

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

Loading…
Cancel
Save