mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
parent
a1ddf17364
commit
2cafd5bba6
@ -181,11 +181,9 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val syncStatusObserver = object : SyncStatusObserver {
|
private val syncStatusObserver = object : SyncStatusObserver {
|
||||||
private val key = context!!.getPreferenceKey(R.string.pref_key_sync_now)
|
|
||||||
|
|
||||||
override fun onStarted() {
|
override fun onStarted() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
val pref = findPreference<Preference>(key)
|
val pref = findPreference<Preference>(context!!.getPreferenceKey(R.string.pref_key_sync_now))
|
||||||
view?.announceForAccessibility(getString(R.string.sync_syncing_in_progress))
|
view?.announceForAccessibility(getString(R.string.sync_syncing_in_progress))
|
||||||
pref?.title = getString(R.string.sync_syncing_in_progress)
|
pref?.title = getString(R.string.sync_syncing_in_progress)
|
||||||
pref?.isEnabled = false
|
pref?.isEnabled = false
|
||||||
@ -197,7 +195,8 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|||||||
// Sync stopped successfully.
|
// Sync stopped successfully.
|
||||||
override fun onIdle() {
|
override fun onIdle() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
findPreference<Preference>(key)?.let { pref ->
|
val pref = findPreference<Preference>(context!!.getPreferenceKey(R.string.pref_key_sync_now))
|
||||||
|
pref?.let {
|
||||||
pref.title = getString(R.string.preferences_sync_now)
|
pref.title = getString(R.string.preferences_sync_now)
|
||||||
pref.isEnabled = true
|
pref.isEnabled = true
|
||||||
updateLastSyncedTimePref(context!!, pref, failed = false)
|
updateLastSyncedTimePref(context!!, pref, failed = false)
|
||||||
@ -208,7 +207,8 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|||||||
// Sync stopped after encountering a problem.
|
// Sync stopped after encountering a problem.
|
||||||
override fun onError(error: Exception?) {
|
override fun onError(error: Exception?) {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
findPreference<Preference>(key)?.let { pref ->
|
val pref = findPreference<Preference>(context!!.getPreferenceKey(R.string.pref_key_sync_now))
|
||||||
|
pref?.let {
|
||||||
pref.title = getString(R.string.preferences_sync_now)
|
pref.title = getString(R.string.preferences_sync_now)
|
||||||
pref.isEnabled = true
|
pref.isEnabled = true
|
||||||
updateLastSyncedTimePref(context!!, pref, failed = true)
|
updateLastSyncedTimePref(context!!, pref, failed = true)
|
||||||
|
Loading…
Reference in New Issue
Block a user