diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index 8883149d0..d83ae0c66 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -457,12 +457,14 @@ on-drop (mf/use-fn (fn [e] - (when (and (not (dnd/has-type? e "penpot/files")) - (or (dnd/has-type? e "Files") - (dnd/has-type? e "application/x-moz-file"))) - (dom/prevent-default e) - (reset! dragging? false) - (import-files (.-files (.-dataTransfer e))))))] + (if can-edit + (when (and (not (dnd/has-type? e "penpot/files")) + (or (dnd/has-type? e "Files") + (dnd/has-type? e "application/x-moz-file"))) + (dom/prevent-default e) + (reset! dragging? false) + (import-files (.-files (.-dataTransfer e)))) + (dom/prevent-default e))))] [:div {:class (stl/css :dashboard-grid) :dragabble (dm/str can-edit) @@ -576,24 +578,26 @@ on-drop (mf/use-fn - (mf/deps files selected-files) + (mf/deps files selected-files can-edit) (fn [e] - (cond - (dnd/has-type? e "penpot/files") - (do - (reset! dragging? false) - (when (not= selected-project project-id) - (let [data {:ids (into #{} (keys selected-files)) - :project-id project-id} - mdata {:on-success on-drop-success}] - (st/emit! (dd/move-files (with-meta data mdata)))))) + (if can-edit + (cond + (dnd/has-type? e "penpot/files") + (do + (reset! dragging? false) + (when (not= selected-project project-id) + (let [data {:ids (into #{} (keys selected-files)) + :project-id project-id} + mdata {:on-success on-drop-success}] + (st/emit! (dd/move-files (with-meta data mdata)))))) - (or (dnd/has-type? e "Files") - (dnd/has-type? e "application/x-moz-file")) - (do - (dom/prevent-default e) - (reset! dragging? false) - (import-files (.-files (.-dataTransfer e)))))))] + (or (dnd/has-type? e "Files") + (dnd/has-type? e "application/x-moz-file")) + (do + (dom/prevent-default e) + (reset! dragging? false) + (import-files (.-files (.-dataTransfer e))))) + (dom/prevent-default e))))] [:div {:class (stl/css :dashboard-grid) :dragabble (dm/str can-edit)