fix #3509: MQTT reporting interval not being selected, and sent to node (#3717)

This commit is contained in:
Dane Evans
2025-11-17 02:37:44 +11:00
committed by GitHub
parent 4a46908ddd
commit 12d96b76db
2 changed files with 6 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ fun MQTTConfigScreen(viewModel: RadioConfigViewModel = hiltViewModel(), onBack:
val consentValid =
if (formState.value.mapReportingEnabled) {
formState.value.mapReportSettings.shouldReportLocation &&
mqttConfig.mapReportSettings.publishIntervalSecs >= MIN_INTERVAL_SECS
formState.value.mapReportSettings.publishIntervalSecs >= MIN_INTERVAL_SECS
} else {
true
}

View File

@@ -51,6 +51,7 @@ import org.meshtastic.core.strings.map_reporting_summary
import org.meshtastic.core.ui.component.DropDownPreference
import org.meshtastic.core.ui.component.SwitchPreference
import org.meshtastic.core.ui.component.precisionBitsToMeters
import org.meshtastic.feature.settings.util.FixedUpdateIntervals
import org.meshtastic.feature.settings.util.IntervalConfiguration
import org.meshtastic.feature.settings.util.toDisplayString
import kotlin.math.roundToInt
@@ -131,10 +132,11 @@ fun MapReportingPreference(
DropDownPreference(
modifier = Modifier.padding(bottom = 16.dp),
title = stringResource(Res.string.map_reporting_interval_seconds),
items = publishItems.map { it.value to it.toDisplayString() },
selectedItem = publishIntervalSecs,
items = publishItems.map { it to it.toDisplayString() },
selectedItem =
FixedUpdateIntervals.fromValue(publishIntervalSecs.toLong()) ?: publishItems.first(),
enabled = enabled,
onItemSelected = { onPublishIntervalSecsChanged(it.toInt()) },
onItemSelected = { onPublishIntervalSecsChanged(it.value.toInt()) },
)
}
}