Only adds a report if it doesn't already exist in the database

This commit is contained in:
Vitor Pamplona
2023-02-14 17:43:19 -05:00
parent c0fe13d79c
commit 4996c5a9d8
2 changed files with 2 additions and 2 deletions
@@ -132,7 +132,7 @@ class Note(val idHex: String) {
if (author !in reports.keys) {
reports = reports + Pair(author, setOf(note))
liveReports.invalidateData()
} else {
} else if (reports[author]?.contains(note) == false) {
reports = reports + Pair(author, (reports[author] ?: emptySet()) + note)
liveReports.invalidateData()
}
@@ -139,7 +139,7 @@ class User(val pubkeyHex: String) {
if (author !in reports.keys) {
reports = reports + Pair(author, setOf(note))
liveReports.invalidateData()
} else {
} else if (reports[author]?.contains(note) == false) {
reports = reports + Pair(author, (reports[author] ?: emptySet()) + note)
liveReports.invalidateData()
}