diff --git a/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt b/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt index 0a123b8281..28564389f2 100644 --- a/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt @@ -386,8 +386,8 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor( } private fun SwitchPreference.setTransactionalSwitchChangeListener(scope: CoroutineScope, transaction: suspend (Boolean) -> Unit) { - val originalState = this.isChecked this.setOnPreferenceChangeListener { switchPreference, isChecked -> + val originalState = this.isChecked scope.launch { try { transaction(isChecked as Boolean)