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:
@@ -4511,7 +4511,10 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
|||||||
'lists-modes': ModesPanel,
|
'lists-modes': ModesPanel,
|
||||||
cluster: ClusterPanel,
|
cluster: ClusterPanel,
|
||||||
udp: UDPIntegrationsPanelWrapper,
|
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,
|
backup: BackupPanel,
|
||||||
database: DatabasePanel,
|
database: DatabasePanel,
|
||||||
uscounties: USCountiesPanel,
|
uscounties: USCountiesPanel,
|
||||||
|
|||||||
Reference in New Issue
Block a user