mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Concurrent modification exception bugfix
This commit is contained in:
parent
a9788cfa63
commit
bd7a4a8372
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user