From 189e77211e14b4e1e1eca8ae0dcce4753fe92ae7 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Fri, 14 Oct 2022 13:46:33 +0200 Subject: [PATCH] Improving when structure --- .../features/settings/labs/VectorSettingsLabsFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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