putting synchronized lists into a synchronized method

This commit is contained in:
Vitor Pamplona
2023-01-22 18:34:21 -03:00
parent d13979b4b5
commit 9c04cb0e30

View File

@ -44,10 +44,12 @@ object NostrThreadDataSource: NostrDataSource<Note>("SingleThreadFeed") {
val loadEventsChannel = requestNewChannel() val loadEventsChannel = requestNewChannel()
override fun feed(): List<Note> { override fun feed(): List<Note> {
return eventsToWatch.map { return synchronized(eventsToWatch) {
eventsToWatch.map {
LocalCache.notes[it] LocalCache.notes[it]
}.filterNotNull() }.filterNotNull()
} }
}
override fun updateChannelFilters() { override fun updateChannelFilters() {
repliesAndReactionsChannel.filter = listOfNotNull(createRepliesAndReactionsFilter()).ifEmpty { null } repliesAndReactionsChannel.filter = listOfNotNull(createRepliesAndReactionsFilter()).ifEmpty { null }