Fixing concurrent modification exception in reactions and boosts

pull/7/head
Vitor Pamplona 2023-01-21 12:41:05 -03:00
rodzic 790dd778bb
commit 5cb6bca224
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -89,11 +89,15 @@ class Note(val idHex: String) {
}
fun isReactedBy(user: User): Boolean {
return reactions.any { it.author == user }
return synchronized(reactions) {
reactions.any { it.author == user }
}
}
fun isBoostedBy(user: User): Boolean {
return boosts.any { it.author == user }
return synchronized(boosts) {
boosts.any { it.author == user }
}
}
// Observers line up here.