diff --git a/src/editors/containers/VideoUploadEditor/VideoUploader.jsx b/src/editors/containers/VideoUploadEditor/VideoUploader.jsx index 8b7a73f94..9ef4d6ef4 100644 --- a/src/editors/containers/VideoUploadEditor/VideoUploader.jsx +++ b/src/editors/containers/VideoUploadEditor/VideoUploader.jsx @@ -12,7 +12,7 @@ import messages from './messages'; const URLUploader = () => { const [textInputValue, setTextInputValue] = React.useState(''); - const onURLUpload = hooks.onVideoUpload(); + const onURLUpload = hooks.onVideoUpload('selectedVideoUrl'); const intl = useIntl(); return (
@@ -67,7 +67,7 @@ export const VideoUploader = ({ setLoading }) => { dispatch(thunkActions.video.uploadVideo({ supportedFiles: [fileData], setLoadSpinner: setLoading, - postUploadRedirect: hooks.onVideoUpload(), + postUploadRedirect: hooks.onVideoUpload('selectedVideoId'), })); }; diff --git a/src/editors/containers/VideoUploadEditor/hooks.js b/src/editors/containers/VideoUploadEditor/hooks.js index d96996d81..e0f3f3847 100644 --- a/src/editors/containers/VideoUploadEditor/hooks.js +++ b/src/editors/containers/VideoUploadEditor/hooks.js @@ -7,15 +7,15 @@ export const { navigateTo, } = appHooks; -export const postUploadRedirect = (storeState) => { +export const postUploadRedirect = (storeState, uploadType = 'selectedVideoUrl') => { const learningContextId = selectors.app.learningContextId(storeState); const blockId = selectors.app.blockId(storeState); - return (videoUrl) => navigateTo(`/course/${learningContextId}/editor/video/${blockId}?selectedVideoUrl=${videoUrl}`); + return (videoUrl) => navigateTo(`/course/${learningContextId}/editor/video/${blockId}?${uploadType}=${videoUrl}`); }; -export const onVideoUpload = () => { +export const onVideoUpload = (uploadType) => { const storeState = store.getState(); - return module.postUploadRedirect(storeState); + return module.postUploadRedirect(storeState, uploadType); }; export const useUploadVideo = async ({