fix(dvk): repair the auto-CQ trace mangled by the previous commit

Shell quoting ate the template literals; the traced loop now compiles.
This commit is contained in:
2026-08-30 02:52:04 +02:00
parent 97567d15dd
commit dad762a0f1
+9 -9
View File
@@ -1748,27 +1748,27 @@ export default function App() {
const sleep = (ms: number) => new Promise((r) => window.setTimeout(r, ms));
// Traced into the app log deliberately: the loop kept 'not repeating' on a
// network rig and every guess at which guard was tripping proved wrong.
const trace = (m: string) => UILog().catch(() => {});
trace();
const trace = (m: string) => UILog(`dvk auto-cq: ${m}`).catch(() => {});
trace(`start slot=${slot} gen=${gen}`);
let round = 0;
while (dvkAutoCqSlotRef.current === slot && gen === dvkAutoCqGenRef.current && dvkActiveRef.current) {
// An EMPTY mode is not a mode change: over the network the rig's mode
// read fails transiently and the CAT push blanks the field for a poll or
// two — killing the auto-CQ loop mid-run for nothing. Only a known
// non-phone mode stops the loop.
if (modeRef.current && !isPhoneMode(modeRef.current)) { trace(); stopDvkAutoCq(); break; }
if (modeRef.current && !isPhoneMode(modeRef.current)) { trace(`stopped: mode ${modeRef.current} is not phone`); stopDvkAutoCq(); break; }
round++;
trace();
await DVKPlay(slot).catch((e: any) => trace());
trace(`round ${round}: play`);
await DVKPlay(slot).catch((e: any) => trace(`play failed: ${e?.message ?? e}`));
await sleep(300); // let playback flip "playing" true
trace();
trace(`round ${round}: playing=${dvkPlayingRef.current}`);
let guard = 0; // then wait for it to finish (cap ~90 s)
while (dvkPlayingRef.current && gen === dvkAutoCqGenRef.current && guard < 600) { await sleep(150); guard++; }
if (gen !== dvkAutoCqGenRef.current) { trace(); break; }
trace();
if (gen !== dvkAutoCqGenRef.current) { trace(`stopped mid-round: superseded (gen ${dvkAutoCqGenRef.current})`); break; }
trace(`round ${round}: message over after ~${(guard * 150 / 1000).toFixed(1)}s, gap ${dvkAutoCqSecsRef.current}s`);
await sleep(Math.max(0, dvkAutoCqSecsRef.current) * 1000); // gap before the next CQ
}
trace();
trace(`exit: slotRef=${dvkAutoCqSlotRef.current} gen=${gen}/${dvkAutoCqGenRef.current} active=${dvkActiveRef.current}`);
}
const dvkPlay = useCallback((slot: number) => {
if (!isPhoneMode(modeRef.current)) { setError(t('dvkp.notPhone')); return; }