diff --git a/frontend/src/app/main/data/workspace/path/edition.cljs b/frontend/src/app/main/data/workspace/path/edition.cljs index a112da657..b8712111b 100644 --- a/frontend/src/app/main/data/workspace/path/edition.cljs +++ b/frontend/src/app/main/data/workspace/path/edition.cljs @@ -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)) diff --git a/frontend/src/app/main/data/workspace/shape_layout.cljs b/frontend/src/app/main/data/workspace/shape_layout.cljs index 8ca06bd2d..e7a3427f3 100644 --- a/frontend/src/app/main/data/workspace/shape_layout.cljs +++ b/frontend/src/app/main/data/workspace/shape_layout.cljs @@ -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 []