fix(mesh-ui): rnodePlan computed for the setup modal (strict TS)
Demo images / Build & push demo images (push) Failing after 4m12s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-08-06 10:35:55 -04:00
co-authored by Claude Fable 5
parent 4773b32a76
commit ee9dde9936
@@ -256,8 +256,8 @@
<p v-if="effectiveKind === 'meshcore' && rfPreset" class="text-[11px] text-sky-300/80 mt-1">
MeshCore RF params for {{ selectedRegion?.code }} are applied to the radio automatically on connect.
</p>
<p v-if="effectiveKind === 'reticulum' && form.region && RNODE_REGION_PLANS[form.region]" class="text-[11px] text-sky-300/80 mt-1">
RNode plan for {{ form.region }}: {{ (RNODE_REGION_PLANS[form.region].frequency / 1e6).toFixed(4) }} MHz, {{ RNODE_REGION_PLANS[form.region].bandwidth / 1000 }} kHz, SF{{ RNODE_REGION_PLANS[form.region].spreading_factor }}, CR4/{{ RNODE_REGION_PLANS[form.region].coding_rate }}, {{ RNODE_REGION_PLANS[form.region].txpower }} dBm applied on connect, and the radio confirms it.
<p v-if="effectiveKind === 'reticulum' && rnodePlan" class="text-[11px] text-sky-300/80 mt-1">
RNode plan for {{ form.region }}: {{ (rnodePlan.frequency / 1e6).toFixed(4) }} MHz, {{ rnodePlan.bandwidth / 1000 }} kHz, SF{{ rnodePlan.spreading_factor }}, CR4/{{ rnodePlan.coding_rate }}, {{ rnodePlan.txpower }} dBm applied on connect, and the radio confirms it.
</p>
<p v-else-if="effectiveKind === 'reticulum'" class="text-[11px] text-sky-300/80 mt-1">
Pick a region to apply its recommended RNode RF plan on connect editable any time in Mesh Device settings.
@@ -376,6 +376,10 @@ const form = ref({
})
const selectedRegion = computed(() => regionByCode(form.value.region))
/** The chosen region's recommended RNode RF plan (undefined = none chosen). */
const rnodePlan = computed(() =>
form.value.region ? RNODE_REGION_PLANS[form.value.region] : undefined,
)
// The firmware whose options we surface: the probe result wins, else the
// last connected type, else meshtastic-style (where presets apply).
const effectiveKind = computed(() => {
@@ -509,12 +513,11 @@ async function applySetup() {
// same round-trip the Device panel uses — the radio confirms the values
// itself after the daemon restarts with them. Best-effort here: a
// failure must not abort the connect the user just asked for.
if (effectiveKind.value === 'reticulum' && form.value.region) {
const plan = RNODE_REGION_PLANS[form.value.region]
if (plan) {
mesh.suppressDeviceDetect()
void mesh.applyRnodeConfig({ enabled: true, port: null, ...plan }).catch(() => {})
}
if (effectiveKind.value === 'reticulum' && rnodePlan.value) {
mesh.suppressDeviceDetect()
void mesh
.applyRnodeConfig({ enabled: true, port: null, ...rnodePlan.value })
.catch(() => {})
}
mesh.dismissDetectedDevice(path)
void router.push('/dashboard/mesh')