fix: bindings on initialization

This commit is contained in:
Konstantinos Kaloutas
2023-05-24 13:00:22 +03:00
parent 8ec5ea7a50
commit c34d5c92f2
2 changed files with 7 additions and 1 deletions

View File

@@ -138,7 +138,8 @@
(when-let [^js api (gobj/get tln "api")]
(p/then (when populate-onboarding?
(whiteboard-handler/populate-onboarding-whiteboard api))
#(do (state/focus-whiteboard-shape tln block-id)
#(do (whiteboard-handler/cleanup! (.-currentPage tln))
(state/focus-whiteboard-shape tln block-id)
(set-loaded-app tln))))))]
(rum/use-effect! (fn []
(when (and loaded-app block-id)

View File

@@ -361,6 +361,11 @@
[^js api ids]
(apply (.-selectShapes api) ids))
(defn cleanup!
[^js tl-page]
(let [shapes (.-shapes tl-page)]
(.cleanup tl-page (map #(.-id %) shapes))))
(defn update-bindings!
[^js tl-page page-name]
(when-let [page (db/entity [:block/name page-name])]