Only adds a report if it doesn't already exist in the database
This commit is contained in:
@@ -132,7 +132,7 @@ class Note(val idHex: String) {
|
|||||||
if (author !in reports.keys) {
|
if (author !in reports.keys) {
|
||||||
reports = reports + Pair(author, setOf(note))
|
reports = reports + Pair(author, setOf(note))
|
||||||
liveReports.invalidateData()
|
liveReports.invalidateData()
|
||||||
} else {
|
} else if (reports[author]?.contains(note) == false) {
|
||||||
reports = reports + Pair(author, (reports[author] ?: emptySet()) + note)
|
reports = reports + Pair(author, (reports[author] ?: emptySet()) + note)
|
||||||
liveReports.invalidateData()
|
liveReports.invalidateData()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class User(val pubkeyHex: String) {
|
|||||||
if (author !in reports.keys) {
|
if (author !in reports.keys) {
|
||||||
reports = reports + Pair(author, setOf(note))
|
reports = reports + Pair(author, setOf(note))
|
||||||
liveReports.invalidateData()
|
liveReports.invalidateData()
|
||||||
} else {
|
} else if (reports[author]?.contains(note) == false) {
|
||||||
reports = reports + Pair(author, (reports[author] ?: emptySet()) + note)
|
reports = reports + Pair(author, (reports[author] ?: emptySet()) + note)
|
||||||
liveReports.invalidateData()
|
liveReports.invalidateData()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user