fix: uploaded video

This commit is contained in:
IlyaDoronin 2023-08-24 14:23:25 +03:00
parent 6ea8bdb1a9
commit cb8e057627
2 changed files with 5 additions and 12 deletions

@ -38,7 +38,6 @@ export default function HelpQuestions({ totalIndex }: HelpQuestionsProps) {
if (fileList?.length) {
const clonContent = listQuestions[totalIndex].content;
clonContent.hint.video = URL.createObjectURL(fileList[0]);
clonContent.hint.videoUrl = "";
updateQuestionsList(totalIndex, { content: clonContent });
handleClose();
}
@ -103,13 +102,9 @@ export default function HelpQuestions({ totalIndex }: HelpQuestionsProps) {
onClick={handleOpen}
sx={{ justifyContent: "flex-start" }}
>
{listQuestions[totalIndex].content.hint.videoUrl ||
listQuestions[totalIndex].content.hint.video ? (
{listQuestions[totalIndex].content.hint.video ? (
<video
src={
listQuestions[totalIndex].content.hint.videoUrl ||
listQuestions[totalIndex].content.hint.video
}
src={listQuestions[totalIndex].content.hint.video}
width="400"
controls
/>
@ -181,11 +176,10 @@ export default function HelpQuestions({ totalIndex }: HelpQuestionsProps) {
</Typography>
<CustomTextField
placeholder={"http://example.com"}
text={listQuestions[totalIndex].content.hint.videoUrl}
text={listQuestions[totalIndex].content.hint.video}
onChange={({ target }) => {
let clonContent = listQuestions[totalIndex].content;
clonContent.hint.videoUrl = target.value;
clonContent.hint.video = "";
clonContent.hint.video = target.value;
updateQuestionsList(totalIndex, { content: clonContent });
}}
/>

@ -10,7 +10,6 @@ export type Variants = {
type Hint = {
text: string;
video: string;
videoUrl: string;
};
export interface Question {
@ -95,12 +94,12 @@ export const createQuestion = (id: number) => {
hint: {
text: "",
video: "",
videoUrl: "",
},
large: false,
multi: false,
own: false,
innerName: "",
// back: "",
},
version: 0,
parent_ids: [0],