mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 00:15:08 +02:00
Refactoring Note's hasReports function
This commit is contained in:
@@ -239,9 +239,9 @@ open class Note(val idHex: String) {
|
|||||||
val dayAgo = Date().time / 1000 - 24 * 60 * 60
|
val dayAgo = Date().time / 1000 - 24 * 60 * 60
|
||||||
return reports.isNotEmpty() ||
|
return reports.isNotEmpty() ||
|
||||||
(
|
(
|
||||||
author?.reports?.values?.filter {
|
author?.reports?.values?.any {
|
||||||
it.firstOrNull { (it.createdAt() ?: 0) > dayAgo } != null
|
it.firstOrNull { (it.createdAt() ?: 0) > dayAgo } != null
|
||||||
}?.isNotEmpty() ?: false
|
} ?: false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user