@@ -36,7 +36,7 @@ import { updateSavingStatus, updateResetStatus } from 'CourseAuthoring/pages-and
3636import AppConfigFormDivider from 'CourseAuthoring/pages-and-resources/discussions/app-config-form/apps/shared/AppConfigFormDivider' ;
3737import { PagesAndResourcesContext } from 'CourseAuthoring/pages-and-resources/PagesAndResourcesProvider' ;
3838
39- import { updateXpertSettings , resetXpertSettings , removeXpertSettings } from '../data/thunks' ;
39+ import { updateXpertSettings , resetXpertSettings } from '../data/thunks' ;
4040import messages from './messages' ;
4141import appInfo from '../appInfo' ;
4242import ResetIcon from './ResetIcon' ;
@@ -235,13 +235,11 @@ const SettingsModal = ({
235235
236236 const handleFormSubmit = async ( { enabled, checked, ...rest } ) => {
237237 let success ;
238- const values = { ...rest , enabled : enabled ? checked === 'true' : undefined } ;
238+ const values = { ...rest , enabled : enabled ? checked === 'true' : false } ;
239239
240- if ( enabled ) {
241- success = await dispatch ( updateXpertSettings ( courseId , values ) ) ;
242- } else {
243- success = await dispatch ( removeXpertSettings ( courseId ) ) ;
244- }
240+ // Always update settings to save the enabled state (true/false)
241+ // Don't delete the record when disabling, as that would fall back to system default
242+ success = await dispatch ( updateXpertSettings ( courseId , values ) ) ;
245243
246244 if ( onSettingsSave ) {
247245 success = success && await onSettingsSave ( values ) ;
0 commit comments