diff --git a/front/components/Editor/Extensions/Video/VideoBlock.ts b/front/components/Editor/Extensions/Video/VideoBlock.ts index 1f7d727f..c38495ac 100644 --- a/front/components/Editor/Extensions/Video/VideoBlock.ts +++ b/front/components/Editor/Extensions/Video/VideoBlock.ts @@ -10,7 +10,7 @@ export default Node.create({ addAttributes() { return { - fileObject: { + blockObject: { default: null, }, }; diff --git a/front/components/Editor/Extensions/Video/VideoBlockComponent.tsx b/front/components/Editor/Extensions/Video/VideoBlockComponent.tsx index eb82929f..35d124c0 100644 --- a/front/components/Editor/Extensions/Video/VideoBlockComponent.tsx +++ b/front/components/Editor/Extensions/Video/VideoBlockComponent.tsx @@ -8,7 +8,7 @@ import { uploadNewVideoFile } from "../../../../services/files/video"; function VideoBlockComponents(props: any) { const [video, setVideo] = React.useState(null); const [isLoading, setIsLoading] = React.useState(false); - const [fileObject, setfileObject] = React.useState(props.node.attrs.fileObject); + const [blockObject, setblockObject] = React.useState(props.node.attrs.fileObject); const handleVideoChange = (event: React.ChangeEvent) => { setVideo(event.target.files[0]); @@ -19,15 +19,15 @@ function VideoBlockComponents(props: any) { setIsLoading(true); let object = await uploadNewVideoFile(video, props.extension.options.lecture.lecture_id); setIsLoading(false); - setfileObject(object); + setblockObject(object); props.updateAttributes({ - fileObject: object, + blockObject: object, }); }; return ( - {!fileObject && ( + {!blockObject && (