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,9 +44,11 @@ object NostrThreadDataSource: NostrDataSource<Note>("SingleThreadFeed") {
val loadEventsChannel = requestNewChannel()
override fun feed(): List<Note> {
return eventsToWatch.map {
LocalCache.notes[it]
}.filterNotNull()
return synchronized(eventsToWatch) {
eventsToWatch.map {
LocalCache.notes[it]
}.filterNotNull()
}
}
override fun updateChannelFilters() {