diff --git a/vector/src/main/java/im/vector/app/features/settings/labs/VectorSettingsLabsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/labs/VectorSettingsLabsFragment.kt index 37998fa2a0..6c31e32567 100644 --- a/vector/src/main/java/im/vector/app/features/settings/labs/VectorSettingsLabsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/labs/VectorSettingsLabsFragment.kt @@ -151,9 +151,9 @@ class VectorSettingsLabsFragment : private fun configureEnableClientInfoRecordingPreference() { findPreference(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