fix: bug on map zoom
This commit is contained in:
@@ -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 (
|
||||
<div className="h-full w-full min-h-0 rounded-lg overflow-hidden border border-border">
|
||||
<FlexPanel />
|
||||
<FlexPanel onCWSpeed={(w) => { setWkWpm(w); WinkeyerSetSpeed(w).catch(() => {}); saveWk({ wpm: w }); }} />
|
||||
</div>
|
||||
);
|
||||
case 'recent':
|
||||
@@ -3913,7 +3918,7 @@ export default function App() {
|
||||
backend is a FlexRadio. */}
|
||||
{catState.backend === 'flex' && (
|
||||
<TabsContent value="flex" className="flex-1 min-h-0 p-0">
|
||||
<FlexPanel />
|
||||
<FlexPanel onCWSpeed={(w) => { setWkWpm(w); WinkeyerSetSpeed(w).catch(() => {}); saveWk({ wpm: w }); }} />
|
||||
</TabsContent>
|
||||
)}
|
||||
|
||||
|
||||
@@ -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<FlexState>(ZERO);
|
||||
const hold = useRef<Record<string, number>>({});
|
||||
// Peak-hold: keep the highest reading for ~2 s so the jittery VITA-49 meters
|
||||
@@ -355,7 +357,7 @@ export function FlexPanel() {
|
||||
<div className="border-t border-border/60 pt-3 space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="w-16 shrink-0 text-[11px] font-bold text-muted-foreground">Speed</span>
|
||||
<Slider value={st.cw_speed} disabled={off} max={60} accent="#0d9488" onChange={(v) => change('cw_speed', v, () => FlexSetCWSpeed(v))} />
|
||||
<Slider value={st.cw_speed} disabled={off} max={60} accent="#0d9488" onChange={(v) => { change('cw_speed', v, () => FlexSetCWSpeed(v)); onCWSpeed?.(v); }} />
|
||||
<span className="w-12 text-right text-xs font-mono tabular-nums text-muted-foreground">{st.cw_speed} wpm</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user