1
0
Fork 0

Fixes #2739. Update sign-in preference visibility when screen is resumed.

master
Denys M 2019-05-23 23:14:52 +03:00 committed by Emily Kager
parent f51e221a99
commit 6b8938e47e
1 changed files with 3 additions and 2 deletions

View File

@ -52,7 +52,7 @@ import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.utils.ItsNotBrokenSnack
import kotlin.coroutines.CoroutineContext
@SuppressWarnings("TooManyFunctions")
@SuppressWarnings("TooManyFunctions", "LargeClass")
class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObserver {
private lateinit var job: Job
override val coroutineContext: CoroutineContext
@ -61,7 +61,6 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
job = Job()
updateSignInVisibility()
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener { sharedPreferences, key ->
try {
@ -118,6 +117,7 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
setupPreferences()
setupAccountUI()
updateSignInVisibility()
}
@Suppress("ComplexMethod")
@ -283,6 +283,7 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
override fun onAuthenticated(account: OAuthAccount) {
updateAuthState(account)
updateSignInVisibility()
}
override fun onError(error: Exception) {