Skip to content

Commit e495559

Browse files
authored
Merge pull request #3116 from PiyushChandra17/piyush/fix-error-modal
Fix error modal pop up
2 parents 568be84 + 46eaf88 commit e495559

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

client/modules/IDE/hooks/useSketchActions.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const useSketchActions = () => {
1616
const unsavedChanges = useSelector((state) => state.ide.unsavedChanges);
1717
const authenticated = useSelector((state) => state.user.authenticated);
1818
const project = useSelector((state) => state.project);
19+
const user = useSelector((state) => state.user);
1920
const canEditProjectName = useSelector(selectCanEditSketch);
2021
const dispatch = useDispatch();
2122
const { t } = useTranslation();
@@ -40,8 +41,10 @@ const useSketchActions = () => {
4041
}
4142

4243
function downloadSketch() {
43-
dispatch(autosaveProject());
44-
exportProjectAsZip(project.id);
44+
if (authenticated && user.id === project.owner.id) {
45+
dispatch(autosaveProject());
46+
exportProjectAsZip(project.id);
47+
}
4548
}
4649

4750
function shareSketch() {

0 commit comments

Comments
 (0)