mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
Improving when structure
This commit is contained in:
parent
86132219d8
commit
189e77211e
1 changed files with 3 additions and 3 deletions
|
@ -151,9 +151,9 @@ class VectorSettingsLabsFragment :
|
|||
private fun configureEnableClientInfoRecordingPreference() {
|
||||
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_CLIENT_INFO_RECORDING_KEY)?.onPreferenceChangeListener =
|
||||
OnPreferenceChangeListener { _, newValue ->
|
||||
when {
|
||||
(newValue as? Boolean) == false -> viewModel.handle(VectorSettingsLabsAction.DeleteRecordedClientInfo)
|
||||
(newValue as? Boolean) == true -> viewModel.handle(VectorSettingsLabsAction.UpdateClientInfo)
|
||||
when (newValue as? Boolean) {
|
||||
false -> viewModel.handle(VectorSettingsLabsAction.DeleteRecordedClientInfo)
|
||||
true -> viewModel.handle(VectorSettingsLabsAction.UpdateClientInfo)
|
||||
else -> Unit
|
||||
}
|
||||
true
|
||||
|
|
Loading…
Reference in a new issue