0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 00:01:51 -05:00

🐛 Fix error on path editing

This commit is contained in:
alonso.torres 2023-01-11 11:42:08 +01:00
parent 7d48b86e46
commit 2da421bb7a
2 changed files with 11 additions and 6 deletions

View file

@ -298,7 +298,10 @@
ptk/WatchEvent
(watch [_ state stream]
(let [mode (get-in state [:workspace-local :edit-path id :edit-mode])
stopper (->> stream (rx/filter (ptk/type? ::start-path-edit)))
stopper (->> stream
(rx/filter #(or
(= (ptk/type %) ::dwe/clear-edition-mode)
(= (ptk/type %) ::start-path-edit))))
interrupt (->> stream (rx/filter #(= % :interrupt)) (rx/take 1))]
(rx/concat
(rx/of (undo/start-path-undo))

View file

@ -82,11 +82,13 @@
[ids]
(ptk/reify ::update-layout-positions
ptk/WatchEvent
(watch [_ _ _]
(if (d/not-empty? ids)
(let [modif-tree (dwm/create-modif-tree ids (ctm/reflow-modifiers))]
(rx/of (dwm/apply-modifiers {:modifiers modif-tree})))
(rx/empty)))))
(watch [_ state _]
(let [objects (wsh/lookup-page-objects state)
ids (->> ids (filter #(contains? objects %)))]
(if (d/not-empty? ids)
(let [modif-tree (dwm/create-modif-tree ids (ctm/reflow-modifiers))]
(rx/of (dwm/apply-modifiers {:modifiers modif-tree})))
(rx/empty))))))
(defn initialize
[]