Skip to content

Commit fa0ff8a

Browse files
authored
Update wardrive.js
1 parent 00d8922 commit fa0ff8a

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎content/wardrive.js‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ async function ensureChannel() {
144144

145145
// ---- Helpers: interval & payload ----
146146
function 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

152153
function 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

0 commit comments

Comments
 (0)