Adding distinctUntilChanged for flow of remote toggle via Pusher capability

This commit is contained in:
Maxime NATUREL 2022-11-08 17:19:06 +01:00
parent 163bf57fda
commit ba5a433caf

View file

@ -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()
} }
} }