From 65c22232dd0be61cba6328ecd33b346991372549 Mon Sep 17 00:00:00 2001 From: rouggy Date: Tue, 30 Jun 2026 09:39:21 +0200 Subject: [PATCH] fix: bug on map zoom --- frontend/src/App.tsx | 9 +++++++-- frontend/src/components/FlexPanel.tsx | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index fdd3a1e..804b30c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1992,6 +1992,11 @@ export default function App() { setLookupBusy(true); try { const r = await LookupCallsign(call); + // Discard a STALE result: the operator already moved to another call + // (clicked a new spot / typed) while this lookup was in flight. Applying it + // would clobber the current call's fields and zoom the map to the wrong + // station — the bug where replacing a call didn't re-zoom the map. + if (call !== callsignValRef.current.trim().toUpperCase()) return; lastLookedUpRef.current = call; // cty.dat carries ONLY DXCC-entity data (country / CQ / ITU zones / continent). // A QRZ/HamQTH hit is far richer (name, QTH, grid, address, image). When the @@ -2858,7 +2863,7 @@ export default function App() { case 'flex': return (
- + { setWkWpm(w); WinkeyerSetSpeed(w).catch(() => {}); saveWk({ wpm: w }); }} />
); case 'recent': @@ -3913,7 +3918,7 @@ export default function App() { backend is a FlexRadio. */} {catState.backend === 'flex' && ( - + { setWkWpm(w); WinkeyerSetSpeed(w).catch(() => {}); saveWk({ wpm: w }); }} /> )} diff --git a/frontend/src/components/FlexPanel.tsx b/frontend/src/components/FlexPanel.tsx index dbe4950..b873169 100644 --- a/frontend/src/components/FlexPanel.tsx +++ b/frontend/src/components/FlexPanel.tsx @@ -187,7 +187,9 @@ function Card({ icon: Icon, title, accent, children }: { icon: any; title: strin ); } -export function FlexPanel() { +// onCWSpeed (optional): notified when the operator changes CW speed here, so the +// host can keep the WinKeyer (which actually sends the macros) in sync. +export function FlexPanel({ onCWSpeed }: { onCWSpeed?: (wpm: number) => void } = {}) { const [st, setSt] = useState(ZERO); const hold = useRef>({}); // Peak-hold: keep the highest reading for ~2 s so the jittery VITA-49 meters @@ -355,7 +357,7 @@ export function FlexPanel() {
Speed - change('cw_speed', v, () => FlexSetCWSpeed(v))} /> + { change('cw_speed', v, () => FlexSetCWSpeed(v)); onCWSpeed?.(v); }} /> {st.cw_speed} wpm