mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +03:00
Adding distinctUntilChanged for flow of remote toggle via Pusher capability
This commit is contained in:
parent
163bf57fda
commit
ba5a433caf
1 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,7 @@ package im.vector.app.features.settings.devices.v2.notification
|
||||||
|
|
||||||
import androidx.lifecycle.asFlow
|
import androidx.lifecycle.asFlow
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.flow.unwrap
|
import org.matrix.android.sdk.flow.unwrap
|
||||||
|
@ -32,5 +33,6 @@ class CanTogglePushNotificationsViaPusherUseCase @Inject constructor() {
|
||||||
.asFlow()
|
.asFlow()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.map { it.canRemotelyTogglePushNotificationsOfDevices }
|
.map { it.canRemotelyTogglePushNotificationsOfDevices }
|
||||||
|
.distinctUntilChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue