Fixes missing emit for null events
This commit is contained in:
+3
-2
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user