mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-21 18:10:33 +02:00
Concurrent modification exception bugfix
This commit is contained in:
@@ -25,8 +25,11 @@ object NostrThreadDataSource: NostrDataSource<Note>("SingleThreadFeed") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun createLoadEventsIfNotLoadedFilter(): JsonFilter? {
|
fun createLoadEventsIfNotLoadedFilter(): JsonFilter? {
|
||||||
val eventsToLoad = eventsToWatch
|
val nodes = synchronized(eventsToWatch) {
|
||||||
.map { LocalCache.notes[it] }
|
eventsToWatch.map { LocalCache.notes[it] }
|
||||||
|
}
|
||||||
|
|
||||||
|
val eventsToLoad = nodes
|
||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.filter { it.event == null }
|
.filter { it.event == null }
|
||||||
.map { it.idHex.substring(0, 8) }
|
.map { it.idHex.substring(0, 8) }
|
||||||
@@ -85,7 +88,9 @@ object NostrThreadDataSource: NostrDataSource<Note>("SingleThreadFeed") {
|
|||||||
thread.add(note)
|
thread.add(note)
|
||||||
threadSet.add(note)
|
threadSet.add(note)
|
||||||
|
|
||||||
note.replies.forEach {
|
synchronized(note.replies) {
|
||||||
|
note.replies.toList()
|
||||||
|
}.forEach {
|
||||||
loadDown(it, thread, threadSet)
|
loadDown(it, thread, threadSet)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -79,8 +79,6 @@ fun HomeScreen(accountViewModel: AccountViewModel, navController: NavController)
|
|||||||
1 -> FeedView(feedViewModelReplies, accountViewModel, navController)
|
1 -> FeedView(feedViewModelReplies, accountViewModel, navController)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user