From 9fd6c65d9314cd70adb2c8ee6d12ab25322bd4de Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 18 Jan 2023 14:34:16 +0100 Subject: [PATCH] :bug: Fix problem with empty paths --- .../src/app/main/data/workspace/path/drawing.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/path/drawing.cljs b/frontend/src/app/main/data/workspace/path/drawing.cljs index ef0e9403d..649d84571 100644 --- a/frontend/src/app/main/data/workspace/path/drawing.cljs +++ b/frontend/src/app/main/data/workspace/path/drawing.cljs @@ -279,11 +279,14 @@ state))) ptk/WatchEvent - (watch [_ _ _] - (rx/of (setup-frame-path) - (dwdc/handle-finish-drawing) - (dwe/start-edition-mode shape-id) - (change-edit-mode :draw))))) + (watch [_ state _] + (let [content (get-in state [:workspace-drawing :object :content] [])] + (if (seq content) + (rx/of (setup-frame-path) + (dwdc/handle-finish-drawing) + (dwe/start-edition-mode shape-id) + (change-edit-mode :draw)) + (rx/of (dwdc/handle-finish-drawing))))))) (defn handle-new-shape "Creates a new path shape"