From dc2d0801c0a98d5938320fd9d796c463d374bf56 Mon Sep 17 00:00:00 2001 From: Jeon Eonseok Date: Wed, 7 Aug 2024 20:25:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20part=20=EC=9D=B4=EB=8F=99=20=EB=90=98?= =?UTF-8?q?=EC=96=B4=EB=8F=84=20=ED=8C=8C=EC=9D=BC=20=EA=B7=B8=EB=8C=80?= =?UTF-8?q?=EB=A1=9C=20=EC=9C=A0=EC=A7=80=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ApplyPage/components/FileInput/index.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/views/ApplyPage/components/FileInput/index.tsx b/src/views/ApplyPage/components/FileInput/index.tsx index 3a89bcae..872eaa1b 100644 --- a/src/views/ApplyPage/components/FileInput/index.tsx +++ b/src/views/ApplyPage/components/FileInput/index.tsx @@ -128,6 +128,8 @@ const FileInput = ({ section, id, isReview, disabled, defaultFile }: FileInputPr }; useEffect(() => { + if (getValues(`file${defaultFileId}`)) return; + if (defaultFileId && defaultFileUrl && defaultFileName) { setValue(`file${defaultFileId}`, { file: defaultFileUrl, @@ -137,11 +139,6 @@ const FileInput = ({ section, id, isReview, disabled, defaultFile }: FileInputPr } if (getValues(`file${id}`) && getValues(`${section}${id}`) === '') setValue(`${section}${id}`, '파일 제출'); - - return () => { - setValue(`file${id}`, undefined); - getValues(`${section}${id}`) === '파일 제출' && setValue(`${section}${id}`, ''); - }; }, [section, id, defaultFileId, defaultFileUrl, defaultFileName, getValues, setValue]); return (