diff --git a/client/src/state/H5PEditor/H5PEditorActions.ts b/client/src/state/H5PEditor/H5PEditorActions.ts index ab9695660..96bcf2c4b 100644 --- a/client/src/state/H5PEditor/H5PEditorActions.ts +++ b/client/src/state/H5PEditor/H5PEditorActions.ts @@ -116,6 +116,16 @@ export function blurActiveElement(): IBlurActiveElementAction { }; } +export function cancelExportH5P() { + log.info(`canceling export`); + return async (dispatch: any) => { + dispatch({ + payload: {}, + type: H5PEDITOR_EXPORT_CANCEL + }); + }; +} + export function exportH5P( includeReporter: boolean, format: 'bundle' | 'external' | 'scorm' diff --git a/client/src/state/H5PEditor/H5PEditorReducer.ts b/client/src/state/H5PEditor/H5PEditorReducer.ts index 084344067..1908b378d 100644 --- a/client/src/state/H5PEditor/H5PEditorReducer.ts +++ b/client/src/state/H5PEditor/H5PEditorReducer.ts @@ -207,7 +207,8 @@ export default function tabReducer( } : tab ), - lockDisplay: false + lockDisplay: false, + showExportDialog: false }; case H5PEDITOR_EXPORT_ERROR: diff --git a/client/src/views/components/H5PEditorExportDialog.tsx b/client/src/views/components/H5PEditorExportDialog.tsx index b57f8e37b..980ae694e 100644 --- a/client/src/views/components/H5PEditorExportDialog.tsx +++ b/client/src/views/components/H5PEditorExportDialog.tsx @@ -38,6 +38,7 @@ export default function H5PEditorExportDialog() { open={open} aria-labelledby="alert-dialog-title" aria-describedby="alert-dialog-description" + onClose={() => dispatch(actions.h5peditor.cancelExportH5P())} > Export settings @@ -116,7 +117,13 @@ export default function H5PEditorExportDialog() { - +