Part 3: Mark accountManager as 'lazy' in Mode.kt

This is enough to cause it to be initialized only if we're going through onboarding.
fennec/production
Grisha Kruglov 4 years ago committed by Grisha Kruglov
parent 3efaa516ca
commit eb98df4edd

@ -50,7 +50,7 @@ class CurrentMode(
private val dispatchModeChanges: (mode: Mode) -> Unit
) : AccountObserver {
private val accountManager = context.components.backgroundServices.accountManager
private val accountManager by lazy { context.components.backgroundServices.accountManager }
fun getCurrentMode() = if (onboarding.userHasBeenOnboarded()) {
Mode.fromBrowsingMode(browsingModeManager.mode)

Loading…
Cancel
Save