diff --git a/changelog.json b/changelog.json index 0500fbc..ef7f65b 100644 --- a/changelog.json +++ b/changelog.json @@ -10,7 +10,8 @@ "Icom network audio: the RX stream is decoded correctly — mono is requested and the payload offset was confirmed on a real IC-7760, curing the garbled, clicking audio.", "Icom: switching back from a data mode (USB-D1) to plain USB now sticks — if the rig ignores the data-flag command, it is repeated with the modern one-frame form (0x26). Seen on the IC-7760.", "Icom console: a DATA mode button (USB-D, what FT8 wants), the PSK button drives the rigs that have a native PSK mode, and the power meter reads in real watts on the IC-7760’s 250 W scale.", - "Icom network audio: the right codec is requested (16-bit mono LPCM), settled by experiment on a real IC-7760." + "Icom network audio: the right codec is requested (16-bit mono LPCM), settled by experiment on a real IC-7760.", + "CAT settings: reopening the panel now shows the radio that is actually selected — it always showed the first one, with the fields (MY_RIG included) silently editing the wrong entry." ], "fr": [ "Console Elecraft : le S-mètre est calibré sur un vrai K3 — S9 et les +dB correspondent désormais à l’affichage de la radio (il lisait environ deux points S trop bas).", @@ -20,7 +21,8 @@ "Audio réseau Icom : le flux RX est décodé correctement — le mono est demandé et l’offset du payload a été confirmé sur un vrai IC-7760, ce qui guérit le son inaudible et les clics.", "Icom : revenir d’un mode data (USB-D1) au USB simple tient désormais — si la radio ignore la commande du drapeau data, elle est répétée sous la forme moderne en une trame (0x26). Constaté sur l’IC-7760.", "Console Icom : un bouton de mode DATA (USB-D, celui de FT8), le bouton PSK pilote les radios qui ont un vrai mode PSK, et le wattmètre lit en watts réels sur l’échelle 250 W de l’IC-7760.", - "Audio réseau Icom : le bon codec est demandé (LPCM mono 16 bits), déterminé par l’expérience sur un vrai IC-7760." + "Audio réseau Icom : le bon codec est demandé (LPCM mono 16 bits), déterminé par l’expérience sur un vrai IC-7760.", + "Réglages CAT : rouvrir le panneau montre désormais la radio réellement sélectionnée — il montrait toujours la première, et les champs (MY_RIG compris) modifiaient silencieusement la mauvaise entrée." ] }, { diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index 1e42d7e..6e041d8 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -9,7 +9,7 @@ import { import { GetLookupSettings, SaveLookupSettings, ClearLookupCache, TestLookupProvider, GetListsSettings, SaveListsSettings, - GetCATSettings, SaveCATSettings, GetRadios, SaveRadios, SetActiveRadio, DiscoverFlexRadios, + GetCATSettings, SaveCATSettings, GetRadios, SaveRadios, SetActiveRadio, ActiveRadioID, DiscoverFlexRadios, ListProfiles, GetActiveProfile, SaveProfile, DeleteProfile, ActivateProfile, DuplicateProfile, GetRotators, SaveRotators, TestRotatorDevice, RotatorPark, RotatorStop, GetRotorPresets, SaveRotorPresets, ResetRotorPresets, @@ -2206,8 +2206,14 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged try { const rl: any = await GetRadios(); setRadios(rl ?? []); - const act = (rl ?? []).find((r: any) => r.active) ?? (rl ?? [])[0]; - setActiveRadioId(act?.id ?? ''); + // The backend is the only one who knows which radio is on the air — + // the list entries carry no 'active' flag, and guessing the first + // meant reopening the panel showed Radio 1's name over the settings + // of whichever radio was actually selected. + let actId = ''; + try { actId = (await ActiveRadioID()) ?? ''; } catch {} + if (!actId || !(rl ?? []).some((r: any) => r.id === actId)) actId = (rl ?? [])[0]?.id ?? ''; + setActiveRadioId(actId); } catch { /* one radio, never listed — the panel works as it always did */ } try { setUltrabeam(await GetUltrabeamSettings() as any); } catch {} try { setAntgenius(await GetAntGeniusSettings() as any); } catch {}