diff --git a/src/components/tasks/form-generator.tsx b/src/components/tasks/form-generator.tsx index 74b50b9..0ec5f1e 100644 --- a/src/components/tasks/form-generator.tsx +++ b/src/components/tasks/form-generator.tsx @@ -191,4 +191,4 @@ export const FormGenerator = ( {children} ); -}; \ No newline at end of file +}; diff --git a/src/components/tasks/task-fields.tsx b/src/components/tasks/task-fields.tsx index 5b2bf3b..d9110cd 100644 --- a/src/components/tasks/task-fields.tsx +++ b/src/components/tasks/task-fields.tsx @@ -26,6 +26,7 @@ export function TaskFields({ task }: { task: Task }) { const [isFirstSurvey, setIsFirstSurvey] = useState(true); const [accepted, setAccepted] = useState(false); const [file, setFile] = useState<{ filePath: string; fileUrl: string } | null>(null); + const [formKey, setFormKey] = useState(0); const formRef = useRef(null); const pathname = usePathname(); const { toast } = useToast() @@ -72,12 +73,11 @@ export function TaskFields({ task }: { task: Task }) { }, [user]); const reset = () => { - if (formRef.current) { - formRef.current.reset(); - } setFormData({}); setMessage(undefined); setFile(null); + setAccepted(false); + setFormKey((k) => k + 1); if (task.type === TaskType.DATALABELLING) { fetchRandomFile(); } else if(task.type === TaskType.SURVEY) { @@ -104,6 +104,7 @@ export function TaskFields({ task }: { task: Task }) {

Task