fix: bug sending LoTW on close

This commit is contained in:
2026-06-18 12:16:39 +02:00
parent b6d991b799
commit e1f1ab4922
6 changed files with 282 additions and 92 deletions
+26 -11
View File
@@ -749,14 +749,14 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
api_key: string; email: string; username: string; password: string; callsign: string;
force_station_callsign: string;
tqsl_path: string; station_location: string; key_password: string;
upload_flag: string; write_log: boolean;
upload_flags: string[]; write_log: boolean;
auto_upload: boolean; upload_mode: string;
};
type ExternalServices = { qrz: ExtServiceCfg; clublog: ExtServiceCfg; lotw: ExtServiceCfg };
const emptyExtCfg = (): ExtServiceCfg => ({
api_key: '', email: '', username: '', password: '', callsign: '',
force_station_callsign: '', tqsl_path: '', station_location: '', key_password: '',
upload_flag: 'R', write_log: false,
upload_flags: ['N', 'R'], write_log: false,
auto_upload: false, upload_mode: 'immediate',
});
const [extSvc, setExtSvc] = useState<ExternalServices>({
@@ -2892,17 +2892,32 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
placeholder="only if your certificate key has a password"
className="text-xs"
/>
<Label className="text-sm">Upload flag</Label>
<Label className="text-sm">Consider as unsent</Label>
<div>
<Select value={lotw.upload_flag || 'R'} onValueChange={(v) => setLotw({ upload_flag: v })}>
<SelectTrigger className="h-8 w-64"><SelectValue /></SelectTrigger>
<SelectContent>
<SelectItem value="N">Upload when LoTW sent = No</SelectItem>
<SelectItem value="R">Upload when LoTW sent = Requested</SelectItem>
</SelectContent>
</Select>
<div className="flex items-center gap-4">
{(['N', 'R'] as const).map((f) => {
const flags = lotw.upload_flags ?? [];
const checked = flags.includes(f);
return (
<label key={f} className="flex items-center gap-2 text-sm cursor-pointer">
<Checkbox
checked={checked}
onCheckedChange={(c) => {
const next = c
? Array.from(new Set([...flags, f]))
: flags.filter((x) => x !== f);
setLotw({ upload_flags: next });
}}
/>
{f === 'N' ? 'No (N)' : 'Requested (R)'}
</label>
);
})}
</div>
<div className="text-[10px] text-muted-foreground mt-1">
Must match your default LoTW <em>sent</em> status in Confirmations, or new QSOs won't be picked up.
At app close, every QSO whose LoTW <em>sent</em> status is one of these is signed and
uploaded in one TQSL batch — including QSOs imported from an ADIF. Uploaded QSOs become
<em> Y</em> and won't be re-sent. Must include your default <em>sent</em> status from Confirmations.
</div>
</div>
</div>
+2 -2
View File
@@ -673,7 +673,7 @@ export namespace extsvc {
tqsl_path: string;
station_location: string;
key_password: string;
upload_flag: string;
upload_flags: string[];
write_log: boolean;
auto_upload: boolean;
upload_mode: string;
@@ -693,7 +693,7 @@ export namespace extsvc {
this.tqsl_path = source["tqsl_path"];
this.station_location = source["station_location"];
this.key_password = source["key_password"];
this.upload_flag = source["upload_flag"];
this.upload_flags = source["upload_flags"];
this.write_log = source["write_log"];
this.auto_upload = source["auto_upload"];
this.upload_mode = source["upload_mode"];