award
This commit is contained in:
@@ -27,8 +27,10 @@ import {
|
||||
WinkeyerConnect, WinkeyerDisconnect, WinkeyerSend, WinkeyerStop, WinkeyerSetSpeed, WinkeyerBackspace,
|
||||
GetDVKMessages, GetDVKStatus, DVKPlay, DVKStop,
|
||||
QSOAudioBegin, QSOAudioCancel,
|
||||
GetAwardDefs,
|
||||
} from '../wailsjs/go/main/App';
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { applyAwardRefs } from '@/lib/awardRefs';
|
||||
import { EventsOn } from '../wailsjs/runtime/runtime';
|
||||
import type { adif as adifModels, lookup as lookupModels, cat as catModels } from '../wailsjs/go/models';
|
||||
import type { QSOForm, WorkedBeforeView, StationSettingsForm, ListsSettingsForm, ModePresetForm } from '@/types';
|
||||
@@ -94,6 +96,7 @@ const emptyDetails: DetailsState = {
|
||||
sat_name: '', sat_mode: '',
|
||||
contest_id: '', srx: undefined, stx: undefined,
|
||||
email: '',
|
||||
award_refs: '',
|
||||
};
|
||||
|
||||
function fmtDateUTC(s: any): string {
|
||||
@@ -658,6 +661,19 @@ export default function App() {
|
||||
});
|
||||
myCallRef.current = (station.callsign || '').toUpperCase();
|
||||
|
||||
// Award code → scanned field (e.g. POTA→pota_ref, WWFF→wwff). Used to route
|
||||
// picked award references to the QSO field/extras each award actually reads.
|
||||
const awardFieldRef = useRef<Record<string, string>>({});
|
||||
useEffect(() => {
|
||||
GetAwardDefs()
|
||||
.then((defs) => {
|
||||
const m: Record<string, string> = {};
|
||||
for (const d of (defs ?? []) as any[]) m[String(d.code).toUpperCase()] = String(d.field || '').toLowerCase();
|
||||
awardFieldRef.current = m;
|
||||
})
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
|
||||
// === Clock ===
|
||||
const [utcNow, setUtcNow] = useState('');
|
||||
useEffect(() => {
|
||||
@@ -1077,6 +1093,7 @@ export default function App() {
|
||||
srx: details.srx, stx: details.stx,
|
||||
email: details.email,
|
||||
};
|
||||
applyAwardRefs(payload, details.award_refs ?? '', awardFieldRef.current);
|
||||
await AddQSO(payload);
|
||||
resetEntry();
|
||||
await refresh();
|
||||
@@ -1096,6 +1113,7 @@ export default function App() {
|
||||
if (!locks.start) setQsoStartedAt(null);
|
||||
if (!locks.end) setQsoEndedAt(null);
|
||||
resetAutoFill();
|
||||
setWb(null); // clear the Worked-before grid for the just-cleared callsign
|
||||
setLookupError('');
|
||||
rstUserEditedRef.current = false;
|
||||
applyModePreset(mode);
|
||||
@@ -1106,6 +1124,7 @@ export default function App() {
|
||||
qsl_msg: '', qsl_via: '',
|
||||
contest_id: '', srx: undefined, stx: undefined,
|
||||
email: '',
|
||||
award_refs: '',
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user