Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Nov 18, 2024
1 parent caca071 commit 24ef5ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ data class InstalledTestDescriptorModel(
val isDefaultTestDescriptor get() = id.value in 10470..10474 // TODO(aanorbel): switch to OONI reserved namespace

val key get() = if (isDefaultTestDescriptor) {
when(id.value) {
when (id.value) {
10470L -> "websites"
10471L -> "instant_messaging"
10472L -> "circumvention"
Expand Down Expand Up @@ -100,15 +100,15 @@ fun InstalledTestDescriptorModel.toDescriptor(updateStatus: UpdateStatus = Updat
icon = icon?.let(InstalledDescriptorIcons::getIconFromValue),
color = color?.hexToColor(),
animation = icon?.let { determineAnimation(it) } ?: animation?.let(Animation::fromFileName),
dataUsage = { if (isDefaultTestDescriptor) stringResource(getDataUsage()) else null },
dataUsage = { if (isDefaultTestDescriptor) stringResource(getDataUsage()) else null },
expirationDate = expirationDate,
netTests = netTests.orEmpty(),
source = Descriptor.Source.Installed(this),
updateStatus = updateStatus,
)

fun InstalledTestDescriptorModel.getDataUsage(): StringResource {
return when(this.key) {
return when (this.key) {
"websites" -> Res.string.websites_datausage
"instant_messaging" -> Res.string.small_datausage
"circumvention" -> Res.string.small_datausage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import org.ooni.probe.domain.FinishInProgressData
import org.ooni.probe.domain.GetAutoRunSettings
import org.ooni.probe.domain.GetAutoRunSpecification
import org.ooni.probe.domain.GetBootstrapTestDescriptors
import org.ooni.probe.domain.GetDefaultTestDescriptors
import org.ooni.probe.domain.GetEnginePreferences
import org.ooni.probe.domain.GetFirstRun
import org.ooni.probe.domain.GetProxySettings
Expand Down Expand Up @@ -248,7 +247,6 @@ class Dependencies(
private val getBootstrapTestDescriptors by lazy {
GetBootstrapTestDescriptors(readAssetFile, json, backgroundContext)
}
private val getDefaultTestDescriptors by lazy { GetDefaultTestDescriptors() }
private val getProxySettings by lazy { GetProxySettings(preferenceRepository) }
private val getEnginePreferences by lazy {
GetEnginePreferences(
Expand Down Expand Up @@ -291,7 +289,7 @@ class Dependencies(
@VisibleForTesting
val getTestDescriptors by lazy {
GetTestDescriptors(
getDefaultTestDescriptors = getDefaultTestDescriptors::invoke,
getDefaultTestDescriptors = { emptyList() },
listInstalledTestDescriptors = testDescriptorRepository::list,
descriptorUpdates = getDescriptorUpdate::observeAvailableUpdatesState,
)
Expand Down

0 comments on commit 24ef5ca

Please sign in to comment.