Fixes missing emit for null events

This commit is contained in:
Vitor Pamplona
2025-12-02 16:05:23 -05:00
parent 71dc25099e
commit 72dc9368fb
@@ -43,6 +43,7 @@ import com.vitorpamplona.quartz.nip51Lists.peopleList.PeopleListEvent
import com.vitorpamplona.quartz.nip72ModCommunities.definition.CommunityDefinitionEvent import com.vitorpamplona.quartz.nip72ModCommunities.definition.CommunityDefinitionEvent
import com.vitorpamplona.quartz.nip72ModCommunities.follow.CommunityListEvent import com.vitorpamplona.quartz.nip72ModCommunities.follow.CommunityListEvent
import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.FlowCollector import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combineTransform import kotlinx.coroutines.flow.combineTransform
@@ -220,11 +221,11 @@ class NoteFeedFlow(
} }
@OptIn(ExperimentalCoroutinesApi::class) @OptIn(ExperimentalCoroutinesApi::class)
override fun flow() = override fun flow(): Flow<IFeedTopNavFilter> =
combineTransform(metadataFlow, outboxRelays, proxyRelays) { noteState, outboxRelays, proxyRelays -> combineTransform(metadataFlow, outboxRelays, proxyRelays) { noteState, outboxRelays, proxyRelays ->
val noteEvent = noteState?.note?.event val noteEvent = noteState?.note?.event
if (noteEvent == null) { if (noteEvent == null) {
AuthorsByOutboxTopNavFilter(emptySet(), blockedRelays) emit(AuthorsByOutboxTopNavFilter(emptySet(), blockedRelays))
} else { } else {
if (proxyRelays.isEmpty()) { if (proxyRelays.isEmpty()) {
processByOutbox(noteEvent, outboxRelays) processByOutbox(noteEvent, outboxRelays)