1
0
Fork 0

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.
master
Grisha Kruglov 2020-03-26 23:21:35 -07:00 committed by Grisha Kruglov
parent 3efaa516ca
commit eb98df4edd
1 changed files with 1 additions and 1 deletions

View File

@ -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)