From 92cee5e7a8324f113778817d2044eadb9b8d127e Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Wed, 21 Feb 2024 18:02:06 +0000 Subject: [PATCH 1/2] Missed commit with last code review changes to DataUploadForm --- website/src/components/Submission/DataUploadForm.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/src/components/Submission/DataUploadForm.tsx b/website/src/components/Submission/DataUploadForm.tsx index 1145066052..25ac986c12 100644 --- a/website/src/components/Submission/DataUploadForm.tsx +++ b/website/src/components/Submission/DataUploadForm.tsx @@ -2,7 +2,7 @@ import { Menu } from '@headlessui/react'; import { isErrorFromAlias } from '@zodios/core'; import type { AxiosError } from 'axios'; import { type DateTime } from 'luxon'; -import { type FormEvent, useMemo, useState, useRef, useEffect, useCallback } from 'react'; +import { type FormEvent, useMemo, useState, useRef, useEffect, useCallback, type ElementType } from 'react'; import { DateChangeModal } from './DateChangeModal'; import { getClientLogger } from '../../clientLogger.ts'; @@ -238,7 +238,7 @@ const UploadComponent = ({ setFile: (file: File | null) => void; name: string; title: string; - Icon: React.ElementType; + Icon: ElementType; fileType: string; }) => { const [myFile, rawSetMyFile] = useState(null); @@ -286,6 +286,7 @@ const UploadComponent = ({ } }); }, 500); + return () => clearInterval(interval); }, [myFile, setMyFile]); return ( @@ -355,7 +356,7 @@ const InnerDataUploadForm = ({ const [sequenceFile, setSequenceFile] = useState(null); const [exampleEntries, setExampleEntries] = useState(10); - const noGroup = useMemo(() => groupsOfUser.length === 0, [groupsOfUser]); + const noGroup = groupsOfUser.length === 0; const { submit, revise, isLoading } = useSubmitFiles(accessToken, organism, clientConfig, onSuccess, onError); const [selectedGroupName, setSelectedGroupName] = useState( From b2fa21888b5fb02744282f4bc5c9bf11c7a1bcc6 Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Wed, 21 Feb 2024 18:04:33 +0000 Subject: [PATCH 2/2] Update DataUploadForm.tsx --- website/src/components/Submission/DataUploadForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/components/Submission/DataUploadForm.tsx b/website/src/components/Submission/DataUploadForm.tsx index 25ac986c12..bd035d1631 100644 --- a/website/src/components/Submission/DataUploadForm.tsx +++ b/website/src/components/Submission/DataUploadForm.tsx @@ -2,7 +2,7 @@ import { Menu } from '@headlessui/react'; import { isErrorFromAlias } from '@zodios/core'; import type { AxiosError } from 'axios'; import { type DateTime } from 'luxon'; -import { type FormEvent, useMemo, useState, useRef, useEffect, useCallback, type ElementType } from 'react'; +import { type FormEvent, useState, useRef, useEffect, useCallback, type ElementType } from 'react'; import { DateChangeModal } from './DateChangeModal'; import { getClientLogger } from '../../clientLogger.ts';