mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-16 19:28:54 +03:00
capturing the original switch state at the point of clicking the switch rather than when the listener is initially set
This commit is contained in:
parent
710f2f92cb
commit
03eb36636d
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue