fix: clear entry-strip award refs when the callsign changes (not only on wipe)

award_refs was only reset when the callsign was emptied, so swapping from one
call to another (e.g. clicking successive spots) kept the previous station's
references in the F3 Awards tab. Move the reset to just past the same-call guard
so any change clears them; the new call's spot POTA + live detection re-populate
right after. Changelog 0.21.1.
This commit is contained in:
2026-07-25 09:24:09 +02:00
parent 9f384402fa
commit b4f0e0bc29
2 changed files with 11 additions and 7 deletions
+7 -5
View File
@@ -2836,17 +2836,19 @@ export default function App() {
// reload worked-before + the band matrix, making them flicker. Compared
// via the ref so it's correct even from the stale UDP closure.
if (v.trim().toUpperCase() === callsignValRef.current.trim().toUpperCase()) return;
// The callsign CHANGED (past the same-call guard) → drop the previous
// contact's award references. They're auto-added per call (live detection
// merges pickable refs into award_refs) or picked by hand, so without clearing
// here they carry over to the NEXT call — e.g. clicking one Italian spot
// (WAIP@RG), then another (WAIP@PG), then EJ7IRB still showing both. The new
// call's lookup re-detects its own refs right after. Covers wipe AND swap.
updateDetails({ award_refs: '' });
// QSO recorder: a non-empty callsign marks the QSO start (the recorder
// keeps the pre-roll from before this); clearing it discards the take.
// Recording START happens on blur (leaving the callsign field), NOT here —
// you may type a call and work it minutes later. Clearing it cancels.
if (v.trim() === '') {
QSOAudioCancel(); setRecording(false); recordingCallRef.current = "";
// Callsign wiped → drop this contact's award references. They are auto-added
// per call (live detection merges pickable refs into award_refs), so without
// this they'd carry over to the NEXT call — e.g. IT9AOT's ref lingering when
// you then type F4BPO, showing both in the F3 Awards tab.
updateDetails({ award_refs: '' });
}
const isEmpty = v.trim() === '';
if (!isEmpty && !locks.start) {