fix: blank ADIF monitor settings panel (hooks in a called-as-function panel)

PANELS[selected]() invokes each settings panel as a plain function, so a panel
must not call hooks. ADIFMonitorPanel uses useState/useEffect/useI18n, which
broke the Rules of Hooks and blanked the section. Render it through JSX
(() => <ADIFMonitorPanel />) so it mounts as a real component with its own
hook context — same pattern as the Flex panel.
This commit is contained in:
2026-07-19 01:51:21 +02:00
parent 79552bfae1
commit 215652570c
+4 -1
View File
@@ -4511,7 +4511,10 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
'lists-modes': ModesPanel,
cluster: ClusterPanel,
udp: UDPIntegrationsPanelWrapper,
adifmon: ADIFMonitorPanel,
// Rendered as a real element (not called as a bare function) so its own hooks
// — useState/useEffect/useI18n — get a proper component context; PANELS[x]()
// is a plain call and hook-holding panels must go through JSX like this.
adifmon: () => <ADIFMonitorPanel />,
backup: BackupPanel,
database: DatabasePanel,
uscounties: USCountiesPanel,