diff --git a/src/course-unit/hooks.jsx b/src/course-unit/hooks.jsx index ffd1c25614..54aa2e4d70 100644 --- a/src/course-unit/hooks.jsx +++ b/src/course-unit/hooks.jsx @@ -21,6 +21,7 @@ import { fetchCourseVerticalChildrenData, getCourseOutlineInfoQuery, patchUnitItemQuery, + updateCourseUnitSidebar, } from './data/thunk'; import { getCanEdit, @@ -221,8 +222,7 @@ export const useCourseUnit = ({ courseId, blockId }) => { // edits the component using editor which has a separate store /* istanbul ignore next */ if (event.key === 'courseRefreshTriggerOnComponentEditSave') { - dispatch(fetchCourseSectionVerticalData(blockId, sequenceId)); - dispatch(fetchCourseVerticalChildrenData(blockId, isSplitTestType)); + dispatch(updateCourseUnitSidebar(blockId)); localStorage.removeItem(event.key); } }; diff --git a/src/editors/data/redux/thunkActions/app.js b/src/editors/data/redux/thunkActions/app.js index 4c5079a5a9..bc71c71b3e 100644 --- a/src/editors/data/redux/thunkActions/app.js +++ b/src/editors/data/redux/thunkActions/app.js @@ -126,9 +126,9 @@ export const saveBlock = (content, returnToUnit) => (dispatch) => { onSuccess: (response) => { dispatch(actions.app.setSaveResponse(response)); const parsedData = JSON.parse(response.config.data); - if (parsedData?.has_changes) { + if (parsedData?.has_changes || !('has_changes' in parsedData)) { const storageKey = 'courseRefreshTriggerOnComponentEditSave'; - localStorage.setItem(storageKey, Date.now()); + sessionStorage.setItem(storageKey, Date.now()); window.dispatchEvent(new StorageEvent('storage', { key: storageKey,