Part 4: Make sure 'sync is on' snackbar does not initialize account manager
parent
eb98df4edd
commit
029fae4559
|
@ -391,7 +391,12 @@ class HomeFragment : Fragment() {
|
|||
)
|
||||
)
|
||||
|
||||
requireComponents.backgroundServices.accountManager.register(currentMode, owner = this)
|
||||
requireComponents.backgroundServices.accountManagerAvailableQueue.runIfReadyOrQueue {
|
||||
// By the time this code runs, we may not be attached to a context.
|
||||
if ((this@HomeFragment).context == null) {
|
||||
return@runIfReadyOrQueue
|
||||
}
|
||||
requireComponents.backgroundServices.accountManager.register(currentMode, owner = this@HomeFragment)
|
||||
requireComponents.backgroundServices.accountManager.register(object : AccountObserver {
|
||||
override fun onAuthenticated(account: OAuthAccount, authType: AuthType) {
|
||||
if (authType != AuthType.Existing) {
|
||||
|
@ -403,7 +408,8 @@ class HomeFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}, owner = this)
|
||||
}, owner = this@HomeFragment)
|
||||
}
|
||||
|
||||
if (context.settings().showPrivateModeContextualFeatureRecommender &&
|
||||
browsingModeManager.mode.isPrivate
|
||||
|
|
Loading…
Reference in New Issue