Skip to content

Commit

Permalink
chore: update check for isDefaultTestDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Dec 4, 2024
1 parent f4054c1 commit 1323b3b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ enum class OoniTest(val id: Long, val key: String) {
private val map = entries.associateBy(OoniTest::id)

fun fromId(id: Long) = map[id]

fun isValidId(id: Long): Boolean {
return entries.any { it.id == id }
}
}
}

Expand Down Expand Up @@ -72,7 +76,7 @@ data class InstalledTestDescriptorModel(

val isExpired get() = expirationDate != null && expirationDate < LocalDateTime.now()

val isDefaultTestDescriptor get() = id.value in 10470..10474 // TODO(aanorbel): switch to OONI reserved namespace
val isDefaultTestDescriptor get() = OoniTest.isValidId(id.value)

val key get() = OoniTest.fromId(id.value)?.key ?: id.value.toString()

Expand Down

0 comments on commit 1323b3b

Please sign in to comment.