fix(entry): stop stray QSO logging from freq-Enter and bare-number DX call

Two ways a bogus contact could be logged:
- Enter in the TX/RX frequency field bubbled to the entry container's
  onKeyDown, which calls save() on Enter-in-an-input. Typing a frequency and
  pressing Enter tuned the rig AND logged the QSO. The freq fields now
  stopPropagation so Enter only tunes.
- WSJT-X/JTDX broadcasts its DX-call field over UDP; when it holds a bare
  number ("1"), applyUdpCall dropped it into the callsign, and the next Enter
  logged a QSO with callsign "1". Reject any DX call with no letter.
This commit is contained in:
2026-08-05 10:45:58 +02:00
parent 61c6666a4c
commit 92ee8aadde
2 changed files with 11 additions and 4 deletions
+7 -2
View File
@@ -2607,6 +2607,11 @@ export default function App() {
const applyUdpCall = (raw: string, force = false): boolean => {
const call = String(raw ?? '').trim();
if (!call) return false;
// A callsign always has at least one letter. WSJT-X/JTDX (and relayed spot
// clicks) sometimes broadcast a bare number in the DX-call field — famously
// "1" — which would land in the entry and, on the next Enter, log a QSO
// with callsign "1". Reject anything with no letter.
if (!/[a-z]/i.test(call)) return false;
const upper = call.toUpperCase();
const current = callsignValRef.current.trim().toUpperCase();
const prev = lastUdpCallRef.current;
@@ -4355,7 +4360,7 @@ export default function App() {
title={catState.connected ? t('field.freqTuneHint') : undefined}
onFocus={() => setFreqFocused(true)}
onBlur={() => setFreqFocused(false)}
onKeyDown={(e) => { if (e.key === 'Enter') tuneRadioTo(freqMhz); }}
onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); tuneRadioTo(freqMhz); } }}
onChange={(e) => { setFreqMhz(e.target.value); noteManualEdit(); const b = bandForMHz(parseFloat(e.target.value)); if (b) setBand(b); }}
/>
</div>
@@ -4370,7 +4375,7 @@ export default function App() {
title={catState.connected ? t('field.freqTuneHint') : undefined}
onFocus={() => setFreqFocused(true)}
onBlur={() => setFreqFocused(false)}
onKeyDown={(e) => { if (e.key === 'Enter') tuneRadioTo(rxFreqMhz); }}
onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); tuneRadioTo(rxFreqMhz); } }}
onChange={(e) => { setRxFreqMhz(e.target.value); noteManualEdit(); const rb = bandForMHz(parseFloat(e.target.value)); if (rb) setBandRx(rb); }}
className={cn('font-mono', catState.split && 'bg-danger-muted/40 border-danger-border focus:bg-card')}
/>