Ts changes weren't staged, it compiles still doesnt build building
This commit is contained in:
@@ -78,6 +78,7 @@ export const UnderlineQuestion: React.FC<UnderlineQuestionProps> = ({
|
||||
|
||||
useEffect(() => {
|
||||
validateQuestion(question);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [question]);
|
||||
|
||||
const handlePromptChange = (value: string) => {
|
||||
|
||||
@@ -32,6 +32,7 @@ const useSectionEdit = ({
|
||||
|
||||
const handleEdit = useCallback(() => {
|
||||
setEditing(true);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [sectionId, setEditing, updateRoot]);
|
||||
|
||||
const handleSave = useCallback(() => {
|
||||
@@ -41,17 +42,20 @@ const useSectionEdit = ({
|
||||
setEditing(false);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [setEditing, updateRoot, onSave, sectionId]);
|
||||
|
||||
const handleDiscard = useCallback(() => {
|
||||
setEditing(false);
|
||||
onDiscard?.();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [setEditing, updateRoot, onDiscard, sectionId]);
|
||||
|
||||
const modeHandle = useCallback(() => {
|
||||
setEditing(!editing);
|
||||
onMode?.();
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [setEditing, editing, updateRoot, onMode, sectionId]);
|
||||
|
||||
return {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ReadingPart } from '@/interfaces/exam';
|
||||
import { defaultSectionSettings } from '@/stores/examEditor/defaults';
|
||||
|
||||
const WordUploader: React.FC<{ module: Module }> = ({ module }) => {
|
||||
const {currentModule, dispatch} = useExamEditorStore();
|
||||
const { currentModule, dispatch } = useExamEditorStore();
|
||||
|
||||
const examInputRef = useRef<HTMLInputElement>(null);
|
||||
const solutionsInputRef = useRef<HTMLInputElement>(null);
|
||||
@@ -38,14 +38,14 @@ const WordUploader: React.FC<{ module: Module }> = ({ module }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleImport = useCallback( async () => {
|
||||
const handleImport = useCallback(async () => {
|
||||
try {
|
||||
if (!examFile) {
|
||||
toast.error('Exam file is required');
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch({type: "UPDATE_MODULE", payload: {updates: {importing: true}, module}})
|
||||
dispatch({ type: "UPDATE_MODULE", payload: { updates: { importing: true }, module } })
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('exercises', examFile);
|
||||
@@ -76,27 +76,30 @@ const WordUploader: React.FC<{ module: Module }> = ({ module }) => {
|
||||
const newSectionsStates = data.parts.map(
|
||||
(part: ReadingPart, index: number) => defaultSectionSettings(module, index + 1, part)
|
||||
);
|
||||
dispatch({type: "UPDATE_MODULE", payload: {
|
||||
updates: {
|
||||
sections: newSectionsStates,
|
||||
minTimer: data.minTimer,
|
||||
importModule: false,
|
||||
importing: false,
|
||||
},
|
||||
module
|
||||
}});
|
||||
dispatch({
|
||||
type: "UPDATE_MODULE", payload: {
|
||||
updates: {
|
||||
sections: newSectionsStates,
|
||||
minTimer: data.minTimer,
|
||||
importModule: false,
|
||||
importing: false,
|
||||
},
|
||||
module
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
toast.error(`An unknown error has occured while import ${module} exam!`);
|
||||
} finally {
|
||||
dispatch({type: "UPDATE_MODULE", payload: {updates: {importing: false}, module}})
|
||||
dispatch({ type: "UPDATE_MODULE", payload: { updates: { importing: false }, module } })
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [
|
||||
examFile,
|
||||
solutionsFile,
|
||||
dispatch,
|
||||
module
|
||||
currentModule
|
||||
]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,7 +7,7 @@ import { capitalize } from "lodash";
|
||||
import { Difficulty } from "@/interfaces/exam";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { toast } from "react-toastify";
|
||||
import { ModuleState } from "@/stores/examEditor/types";
|
||||
import { ModuleState, SectionState } from "@/stores/examEditor/types";
|
||||
import { Module } from "@/interfaces";
|
||||
import useExamEditorStore from "@/stores/examEditor";
|
||||
import WritingSettings from "./SettingsEditor/writing";
|
||||
@@ -38,8 +38,8 @@ const ExamEditor: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const currentSections = sections;
|
||||
const currentLabels = sectionLabels;
|
||||
let updatedSections;
|
||||
let updatedLabels;
|
||||
let updatedSections: SectionState[];
|
||||
let updatedLabels: any;
|
||||
|
||||
if (numberOfParts > currentSections.length) {
|
||||
const newSections = [...currentSections];
|
||||
@@ -76,6 +76,7 @@ const ExamEditor: React.FC = () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [numberOfParts]);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user