mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Refresh push pref after diagnostic
This commit is contained in:
parent
2ed7be243b
commit
b26d379d20
1 changed files with 12 additions and 2 deletions
|
@ -88,7 +88,7 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
||||||
it.summary = secondsToText(vectorPreferences.backgroundSyncTimeOut())
|
it.summary = secondsToText(vectorPreferences.backgroundSyncTimeOut())
|
||||||
it.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
it.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
||||||
if (newValue is String) {
|
if (newValue is String) {
|
||||||
val syncTimeout = tryThis { Integer.parseInt(newValue) } ?: 6
|
val syncTimeout = tryThis { Integer.parseInt(newValue) } ?: 6
|
||||||
vectorPreferences.setBackgroundSyncTimeout(maxOf(0, syncTimeout))
|
vectorPreferences.setBackgroundSyncTimeout(maxOf(0, syncTimeout))
|
||||||
refreshBackgroundSyncPrefs()
|
refreshBackgroundSyncPrefs()
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
||||||
it.summary = secondsToText(vectorPreferences.backgroundSyncDelay())
|
it.summary = secondsToText(vectorPreferences.backgroundSyncDelay())
|
||||||
it.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
it.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
||||||
if (newValue is String) {
|
if (newValue is String) {
|
||||||
val syncDelay = tryThis { Integer.parseInt(newValue) } ?: 6
|
val syncDelay = tryThis { Integer.parseInt(newValue) } ?: 6
|
||||||
vectorPreferences.setBackgroundSyncDelay(maxOf(0, syncDelay))
|
vectorPreferences.setBackgroundSyncDelay(maxOf(0, syncDelay))
|
||||||
refreshBackgroundSyncPrefs()
|
refreshBackgroundSyncPrefs()
|
||||||
}
|
}
|
||||||
|
@ -244,6 +244,16 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
||||||
val preference = findPreference<VectorSwitchPreference>(key)
|
val preference = findPreference<VectorSwitchPreference>(key)
|
||||||
preference?.isHighlighted = true
|
preference?.isHighlighted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshPref()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun refreshPref() {
|
||||||
|
// This pref may have change from troubleshoot pref fragment
|
||||||
|
if (!FcmHelper.isPushSupported()) {
|
||||||
|
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_START_ON_BOOT_PREFERENCE_KEY)
|
||||||
|
?.isChecked = vectorPreferences.autoStartOnBoot()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
|
|
Loading…
Reference in a new issue