File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,16 +144,17 @@ async function ensureChannel() {
144144
145145// ---- Helpers: interval & payload ----
146146function getSelectedIntervalMs ( ) {
147- const s = intervalSelect ?. value ? Number ( intervalSelect . value ) : DEFAULT_INTERVAL_S ;
148- const clamped = [ 15 , 30 , 60 ] . includes ( s ) ? s : DEFAULT_INTERVAL_S ;
147+ const checked = document . querySelector ( 'input[name="interval"]:checked' ) ;
148+ const s = checked ? Number ( checked . value ) : 30 ;
149+ const clamped = [ 15 , 30 , 60 ] . includes ( s ) ? s : 30 ;
149150 return clamped * 1000 ;
150151}
151152
152153function buildPayload ( lat , lon ) {
153- const coordsStr = `${ lat . toFixed ( 5 ) } ${ lon . toFixed ( 5 ) } ` ; // "LAT LON"
154- const power = powerSelect ?. value ?? "" ;
155- // Append power only if specified; wrap in square brackets at the very end.
156- const suffix = power ? ` [${ power } ]` : "" ;
154+ const coordsStr = `${ lat . toFixed ( 5 ) } ${ lon . toFixed ( 5 ) } ` ;
155+ const checkedPower = document . querySelector ( 'input[name="power"]:checked' ) ;
156+ const power = checkedPower ? checkedPower . value : "" ;
157+ const suffix = power ? ` [${ power } ]` : "" ;
157158 return `${ PING_PREFIX } <${ coordsStr } >${ suffix } ` ;
158159}
159160
You can’t perform that action at this time.
0 commit comments