From 4bbd53255f0d2eb628984e12b29d3d620b01e4e6 Mon Sep 17 00:00:00 2001 From: Piyush Date: Tue, 14 May 2024 01:55:04 +0530 Subject: [PATCH] Fix error modal pop up --- client/modules/IDE/hooks/useSketchActions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/hooks/useSketchActions.js b/client/modules/IDE/hooks/useSketchActions.js index 3c7b0e3d87..a4c5d70235 100644 --- a/client/modules/IDE/hooks/useSketchActions.js +++ b/client/modules/IDE/hooks/useSketchActions.js @@ -16,6 +16,7 @@ const useSketchActions = () => { const unsavedChanges = useSelector((state) => state.ide.unsavedChanges); const authenticated = useSelector((state) => state.user.authenticated); const project = useSelector((state) => state.project); + const user = useSelector((state) => state.user); const canEditProjectName = useSelector(selectCanEditSketch); const dispatch = useDispatch(); const { t } = useTranslation(); @@ -40,8 +41,10 @@ const useSketchActions = () => { } function downloadSketch() { - dispatch(autosaveProject()); - exportProjectAsZip(project.id); + if (authenticated && user.id === project.owner.id) { + dispatch(autosaveProject()); + exportProjectAsZip(project.id); + } } function shareSketch() {