Skip to content

Commit

Permalink
re-run check only on projectId change
Browse files Browse the repository at this point in the history
  • Loading branch information
andracc committed Nov 15, 2024
1 parent fd7b229 commit a097dc3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/ProjectExport/ExportButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ export default function ExportButton(props: ExportButtonProps): ReactElement {
exportResult.status === ExportStatus.Downloading;

useEffect(() => {
const fetchNonempty = async (): Promise<void> => {
await isFrontierNonempty(props.projectId).then(setExports);
};
fetchNonempty().catch(console.error);
});
isFrontierNonempty(props.projectId).then(setExports);
}, [props.projectId]);

return (
<Tooltip title={!exports ? t("projectExport.cannotExportEmpty") : ""}>
Expand Down

0 comments on commit a097dc3

Please sign in to comment.