mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
Fix monitor mode being set to ALWAYS when visiting the reactions settings screen.
Fixes #41
This commit is contained in:
@@ -88,10 +88,15 @@ class ReactionSettingsFragment : PreferenceFragment3() {
|
||||
return super.onPreferenceTreeClick(preference)
|
||||
}
|
||||
|
||||
// Some UI interactions shortly turn autoConnect on, then off again
|
||||
private val previousMonitorMode by lazy { generalSettings.monitorMode.value }
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
settings.autoConnect.flow.asLiveData().observe2 {
|
||||
generalSettings.monitorMode.value = MonitorMode.ALWAYS
|
||||
autoConnectConditionPref.isEnabled = it
|
||||
settings.autoConnect.flow.asLiveData().observe2 { isEnabled ->
|
||||
if (isEnabled) generalSettings.monitorMode.value = MonitorMode.ALWAYS
|
||||
else generalSettings.monitorMode.value = previousMonitorMode
|
||||
|
||||
autoConnectConditionPref.isEnabled = isEnabled
|
||||
}
|
||||
|
||||
vm.isPro.observe2 { isPro = it }
|
||||
|
||||
Reference in New Issue
Block a user