From ee9dde9936e3d5c91f1c5b4c967e757767af9a79 Mon Sep 17 00:00:00 2001 From: archipelago Date: Thu, 6 Aug 2026 10:35:55 -0400 Subject: [PATCH] fix(mesh-ui): rnodePlan computed for the setup modal (strict TS) Co-Authored-By: Claude Fable 5 --- .../components/mesh/MeshDeviceSetupModal.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/neode-ui/src/components/mesh/MeshDeviceSetupModal.vue b/neode-ui/src/components/mesh/MeshDeviceSetupModal.vue index 29ad023c..d5650761 100644 --- a/neode-ui/src/components/mesh/MeshDeviceSetupModal.vue +++ b/neode-ui/src/components/mesh/MeshDeviceSetupModal.vue @@ -256,8 +256,8 @@

MeshCore RF params for {{ selectedRegion?.code }} are applied to the radio automatically on connect.

-

- 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. +

+ 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.

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')