fix: Cabrillo contest

This commit is contained in:
2026-07-04 18:06:11 +02:00
parent ee9fb51066
commit fda21e5a6f
4 changed files with 43 additions and 33 deletions
+5 -11
View File
@@ -1981,37 +1981,31 @@ export default function App() {
showToast(`Exported ${r.count} selected QSO${r.count > 1 ? 's' : ''}${r.path}`);
} catch (e: any) { setError(String(e?.message ?? e)); }
}
// Cabrillo (contest log) export — prompts for the contest name, then writes a
// .cbr file. All / filtered / selected variants mirror the ADIF ones.
// Cabrillo (contest log) export → a .log file. The contest name comes from the
// QSOs' ADIF CONTEST_ID (no prompt). All / filtered / selected mirror the ADIF ones.
async function exportCabrillo() {
const contest = window.prompt('Contest name for Cabrillo (e.g. CQ-WW-SSB):', '');
if (contest === null) return;
try {
const path = await SaveCabrilloFile();
if (!path) return;
const r = await ExportCabrillo(path, contest);
const r = await ExportCabrillo(path);
showToast(`Cabrillo: ${r.count} QSO${r.count > 1 ? 's' : ''}${r.path}`);
} catch (e: any) { setError(String(e?.message ?? e)); }
}
async function exportFilteredCabrillo() {
const contest = window.prompt('Contest name for Cabrillo (e.g. CQ-WW-SSB):', '');
if (contest === null) return;
try {
const path = await SaveCabrilloFile();
if (!path) return;
const f = buildActiveFilter();
const r = await ExportCabrilloFiltered(path, contest, { ...f, limit: 0, offset: 0 } as any);
const r = await ExportCabrilloFiltered(path, { ...f, limit: 0, offset: 0 } as any);
showToast(`Cabrillo: ${r.count} QSO${r.count > 1 ? 's' : ''}${r.path}`);
} catch (e: any) { setError(String(e?.message ?? e)); }
}
async function exportSelectedCabrillo(ids: number[]) {
if (ids.length === 0) return;
const contest = window.prompt('Contest name for Cabrillo (e.g. CQ-WW-SSB):', '');
if (contest === null) return;
try {
const path = await SaveCabrilloFile();
if (!path) return;
const r = await ExportCabrilloSelected(path, contest, ids as any);
const r = await ExportCabrilloSelected(path, ids as any);
showToast(`Cabrillo: ${r.count} selected QSO${r.count > 1 ? 's' : ''}${r.path}`);
} catch (e: any) { setError(String(e?.message ?? e)); }
}