Part 4: Make sure 'sync is on' snackbar does not initialize account manager
parent
eb98df4edd
commit
029fae4559
|
@ -391,19 +391,25 @@ class HomeFragment : Fragment() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
requireComponents.backgroundServices.accountManager.register(currentMode, owner = this)
|
requireComponents.backgroundServices.accountManagerAvailableQueue.runIfReadyOrQueue {
|
||||||
requireComponents.backgroundServices.accountManager.register(object : AccountObserver {
|
// By the time this code runs, we may not be attached to a context.
|
||||||
override fun onAuthenticated(account: OAuthAccount, authType: AuthType) {
|
if ((this@HomeFragment).context == null) {
|
||||||
if (authType != AuthType.Existing) {
|
return@runIfReadyOrQueue
|
||||||
view?.let {
|
}
|
||||||
FenixSnackbar.make(it, Snackbar.LENGTH_SHORT)
|
requireComponents.backgroundServices.accountManager.register(currentMode, owner = this@HomeFragment)
|
||||||
.setText(it.context.getString(R.string.onboarding_firefox_account_sync_is_on))
|
requireComponents.backgroundServices.accountManager.register(object : AccountObserver {
|
||||||
.setAnchorView(toolbarLayout)
|
override fun onAuthenticated(account: OAuthAccount, authType: AuthType) {
|
||||||
.show()
|
if (authType != AuthType.Existing) {
|
||||||
|
view?.let {
|
||||||
|
FenixSnackbar.make(it, Snackbar.LENGTH_SHORT)
|
||||||
|
.setText(it.context.getString(R.string.onboarding_firefox_account_sync_is_on))
|
||||||
|
.setAnchorView(toolbarLayout)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}, owner = this@HomeFragment)
|
||||||
}, owner = this)
|
}
|
||||||
|
|
||||||
if (context.settings().showPrivateModeContextualFeatureRecommender &&
|
if (context.settings().showPrivateModeContextualFeatureRecommender &&
|
||||||
browsingModeManager.mode.isPrivate
|
browsingModeManager.mode.isPrivate
|
||||||
|
|
Loading…
Reference in New Issue