diff --git a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryUseCase.kt b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryUseCase.kt index a51a200..7e327fc 100644 --- a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryUseCase.kt +++ b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryUseCase.kt @@ -1,6 +1,5 @@ package app.dapk.st.directory -import android.util.Log import app.dapk.st.matrix.common.CredentialsStore import app.dapk.st.matrix.common.RoomId import app.dapk.st.matrix.common.RoomMember @@ -40,7 +39,6 @@ class DirectoryUseCase( roomStore.observeUnreadCountById(), syncService.events() ) { userId, overviewState, localEchos, unread, events -> - Log.e("!!!", "got states") overviewState.mergeWithLocalEchos(localEchos, userId).map { roomOverview -> RoomFoo( overview = roomOverview, diff --git a/features/notifications/src/main/kotlin/app/dapk/st/notifications/PushAndroidService.kt b/features/notifications/src/main/kotlin/app/dapk/st/notifications/PushAndroidService.kt index 20bbeb4..8b845c7 100644 --- a/features/notifications/src/main/kotlin/app/dapk/st/notifications/PushAndroidService.kt +++ b/features/notifications/src/main/kotlin/app/dapk/st/notifications/PushAndroidService.kt @@ -10,10 +10,9 @@ import app.dapk.st.matrix.common.RoomId import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import kotlinx.coroutines.* +import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.firstOrNull -import kotlinx.coroutines.flow.map -import kotlinx.coroutines.flow.merge private var previousJob: Job? = null @@ -70,8 +69,7 @@ class PushAndroidService : FirebaseMessagingService() { private suspend fun waitForEvent(timeout: Long, eventId: EventId): EventId? { return withTimeoutOrNull(timeout) { - val syncFlow = module.syncService().startSyncing().map { it as EventId } - merge(syncFlow, module.syncService().observeEvent(eventId)) + combine(module.syncService().startSyncing(), module.syncService().observeEvent(eventId)) { _, event -> event } .firstOrNull { it == eventId }