From a097dc3fceb146dc212d418f51374d69b7b1ff25 Mon Sep 17 00:00:00 2001 From: Andra Constantin Date: Fri, 15 Nov 2024 17:35:35 -0500 Subject: [PATCH] re-run check only on projectId change --- src/components/ProjectExport/ExportButton.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/ProjectExport/ExportButton.tsx b/src/components/ProjectExport/ExportButton.tsx index cf027b9a9a..8c9585a439 100644 --- a/src/components/ProjectExport/ExportButton.tsx +++ b/src/components/ProjectExport/ExportButton.tsx @@ -34,11 +34,8 @@ export default function ExportButton(props: ExportButtonProps): ReactElement { exportResult.status === ExportStatus.Downloading; useEffect(() => { - const fetchNonempty = async (): Promise => { - await isFrontierNonempty(props.projectId).then(setExports); - }; - fetchNonempty().catch(console.error); - }); + isFrontierNonempty(props.projectId).then(setExports); + }, [props.projectId]); return (