fix: zoom taking too long after clicking a spot
This commit is contained in:
@@ -818,6 +818,7 @@ export default function App() {
|
||||
// worked-before grid. Per-profile (stored via SetUIPref → profile-prefixed),
|
||||
// so it's loaded async on mount and re-read on profile:changed below.
|
||||
type MainPaneKind = 'map1' | 'map2' | 'cluster' | 'worked' | 'flex' | 'recent';
|
||||
const [mapZoomSignal, setMapZoomSignal] = useState(0); // bump → world map auto-zooms now
|
||||
const [mainPaneLeft, setMainPaneLeft] = useState<MainPaneKind>('map1');
|
||||
const [mainPaneRight, setMainPaneRight] = useState<MainPaneKind>('map2');
|
||||
const loadMainPanes = useCallback(async () => {
|
||||
@@ -2028,6 +2029,9 @@ export default function App() {
|
||||
qsl_via: d.qsl_via || (r.qsl_via ?? ''),
|
||||
}));
|
||||
if (r.dxcc && r.dxcc > 0) runWorkedBefore(call, r.dxcc);
|
||||
// The DX location is now known (grid set above) — force the world map to
|
||||
// auto-zoom right away, so it doesn't lag behind the resolved QSO.
|
||||
setMapZoomSignal((n) => n + 1);
|
||||
// Recording: tie it to the resolved callsign. Start once a real (≥3-char)
|
||||
// call resolves — covers the fast CW workflow (type → Enter, no blur). If
|
||||
// we're already recording a DIFFERENT call (the operator edited the
|
||||
@@ -2823,6 +2827,7 @@ export default function App() {
|
||||
toLabel={callsign}
|
||||
beamAzimuths={showBeamOnMap ? beamHeadings : []}
|
||||
boomAzimuth={showBeamOnMap && ubPattern && ubPattern !== 'normal' ? boomHeading : null}
|
||||
zoomSignal={mapZoomSignal}
|
||||
/>
|
||||
);
|
||||
case 'map2':
|
||||
|
||||
Reference in New Issue
Block a user