From 8b6f72a09b7b7fee44137ee98c69abcd03b61dfb Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 27 Apr 2020 17:12:14 +0200 Subject: [PATCH] :bug: Peroper handle hot-reload on worker. --- frontend/src/uxbox/main/ui/workspace.cljs | 2 -- frontend/src/uxbox/util/geom/shapes.cljs | 4 ++-- frontend/src/uxbox/worker.cljs | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/uxbox/main/ui/workspace.cljs b/frontend/src/uxbox/main/ui/workspace.cljs index 9f8a2e893..5067619f4 100644 --- a/frontend/src/uxbox/main/ui/workspace.cljs +++ b/frontend/src/uxbox/main/ui/workspace.cljs @@ -79,7 +79,6 @@ (fn [] (st/emit! (dw/initialize-page page-id)) #(st/emit! (dw/finalize-page page-id)))) - (when-let [page (mf/deref refs/workspace-page)] [:& workspace-content {:page page :project project @@ -100,7 +99,6 @@ (let [file (mf/deref refs/workspace-file) project (mf/deref refs/workspace-project) layout (mf/deref refs/workspace-layout)] - [:* [:& header {:file file :project project diff --git a/frontend/src/uxbox/util/geom/shapes.cljs b/frontend/src/uxbox/util/geom/shapes.cljs index 293ed6f51..485177d36 100644 --- a/frontend/src/uxbox/util/geom/shapes.cljs +++ b/frontend/src/uxbox/util/geom/shapes.cljs @@ -424,7 +424,7 @@ (let [shape-center (center shape)] (-> shape (transform - (-> (gmt/matrix) + (-> (gmt/matrix) (gmt/translate shape-center) (gmt/multiply matrix) (gmt/translate (gpt/negate shape-center))))))) @@ -790,7 +790,7 @@ (merge rec) (update :transform #(gmt/multiply (or % (gmt/matrix)) stretch-matrix)) (update :transform-inverse #(gmt/multiply stretch-matrix-inverse (or % (gmt/matrix)))))] - + new-shape)) (defn transform-path-shape diff --git a/frontend/src/uxbox/worker.cljs b/frontend/src/uxbox/worker.cljs index 39ea0645f..c5ee4ef01 100644 --- a/frontend/src/uxbox/worker.cljs +++ b/frontend/src/uxbox/worker.cljs @@ -72,3 +72,9 @@ (defn ^:dev/before-load stop [] (.removeEventListener js/self "message" on-message)) + +(defn ^:dev/after-load start [] + [] + (.addEventListener js/self "message" on-message)) + +