diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index ea085d017..d39e03ec9 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -177,6 +177,15 @@ const AdvancedSettingsPanel = ({ ) ) + const handleModeButtonToggle = setModeButton( + enabledModeButtons, + onSettingsUpdate(setQueryParam) + ) + + const handleAllSubmodesDisabled = (modeButton: ModeButtonDefinition) => { + handleModeButtonToggle(modeButton.key, false) + } + const onSaveAndReturnClick = useCallback(async () => { await setCloseAdvancedSettingsWithDelay() setClosingBySave(true) @@ -221,11 +230,9 @@ const AdvancedSettingsPanel = ({ id: 'components.BatchSearchScreen.submodeSelectorLabel' })} modeButtons={processedModeButtons} + onAllSubmodesDisabled={handleAllSubmodesDisabled} onSettingsUpdate={onSettingsUpdate(setQueryParam)} - onToggleModeButton={setModeButton( - enabledModeButtons, - onSettingsUpdate(setQueryParam) - )} + onToggleModeButton={handleModeButtonToggle} /> {saveAndReturnButton && (