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