mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 02:28:18 -05:00
🐛 [Prototype] Prototype mode should not allow edits
This commit is contained in:
parent
b4c87ad0b9
commit
d2590c7651
2 changed files with 15 additions and 2 deletions
|
@ -754,9 +754,13 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [selected (wsh/lookup-selected state)
|
(let [selected (wsh/lookup-selected state)
|
||||||
hover-guides (get-in state [:workspace-guides :hover])]
|
hover-guides (get-in state [:workspace-guides :hover])
|
||||||
|
options-mode (get-in state [:workspace-global :options-mode])]
|
||||||
(cond
|
(cond
|
||||||
(d/not-empty? selected)
|
(and (= options-mode :prototype) (d/not-empty? selected))
|
||||||
|
(rx/of (dwi/remove-interactions selected))
|
||||||
|
|
||||||
|
(and (= options-mode :design) (d/not-empty? selected))
|
||||||
(rx/of (dwc/delete-shapes selected)
|
(rx/of (dwc/delete-shapes selected)
|
||||||
(dws/deselect-all))
|
(dws/deselect-all))
|
||||||
|
|
||||||
|
|
|
@ -171,6 +171,15 @@
|
||||||
(update shape :interactions
|
(update shape :interactions
|
||||||
csi/remove-interaction index)))))))
|
csi/remove-interaction index)))))))
|
||||||
|
|
||||||
|
(defn remove-interactions
|
||||||
|
[ids]
|
||||||
|
(ptk/reify ::remove-interactions
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [_ _ _]
|
||||||
|
(rx/of (dch/update-shapes ids
|
||||||
|
(fn [shape]
|
||||||
|
(assoc shape :interactions [])))))))
|
||||||
|
|
||||||
(defn update-interaction
|
(defn update-interaction
|
||||||
[shape index update-fn]
|
[shape index update-fn]
|
||||||
(ptk/reify ::update-interaction
|
(ptk/reify ::update-interaction
|
||||||
|
|
Loading…
Add table
Reference in a new issue