Skip to content

Commit

Permalink
refactor: after second review
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed May 7, 2024
1 parent bc6f9d7 commit c7007a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/course-unit/CourseUnit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ describe('<CourseUnit />', () => {

userEvent.click(xblockEditBtn);

const iframePostMsg = getIFramePostMessages('close_edit_modal');
const iframePostMsg = getIFramePostMessages('close_modal');
const editModalIFrame = getByTitle('xblock-edit-modal-iframe');

expect(editModalIFrame).toHaveAttribute('src', `${getConfig().STUDIO_BASE_URL}/xblock/${courseVerticalChildrenMock.children[0].block_id}/actions/edit`);
Expand Down
7 changes: 1 addition & 6 deletions src/course-unit/course-xblock/CourseXBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,11 @@ const CourseXBlock = memo(({
const handleMessage = (event) => {
const { method, params } = event.data;

if (method === 'close_edit_modal') {
if (method === 'close_modal') {
toggleLegacyEditModal(false);
dispatch(fetchCourseVerticalChildrenData(blockId));
dispatch(fetchXBlockIFrameHtmlAndResourcesQuery(id));
dispatch(fetchCourseUnitQuery(blockId));
} else if (method === 'close_move_modal') {
toggleLegacyMoveModal(false);
dispatch(fetchCourseVerticalChildrenData(blockId));
dispatch(fetchXBlockIFrameHtmlAndResourcesQuery(id));
dispatch(fetchCourseUnitQuery(blockId));
} else if (method === 'move_xblock') {
toggleLegacyMoveModal(false);
dispatch(updateMovedXBlockParams({
Expand Down

0 comments on commit c7007a7

Please sign in to comment.