diff --git a/common/src/app/common/types/component.cljc b/common/src/app/common/types/component.cljc index b26461f2b..53b60c454 100644 --- a/common/src/app/common/types/component.cljc +++ b/common/src/app/common/types/component.cljc @@ -29,7 +29,7 @@ (sm/register! ::component schema:component) -(def check-component! +(def check-component (sm/check-fn schema:component)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 2cf8ad292..d61f68235 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -713,8 +713,10 @@ (defn go-to-component-file [file-id component] - (dm/assert! (uuid? file-id)) - (dm/assert! (some? component)) + + (assert (uuid? file-id) "expected an uuid for `file-id`") + (assert (ctk/check-component component) "expected a valid component") + (ptk/reify ::nav-to-component-file ptk/WatchEvent (watch [_ state _] @@ -722,8 +724,7 @@ (assoc :file-id file-id) (assoc :page-id (:main-instance-page component)) (assoc :component-id (:id component)))] - (rx/of (rt/nav :workspace params :new-window? true)))))) - + (rx/of (rt/nav :workspace params ::rt/new-window true)))))) (defn go-to-local-component [& {:keys [id] :as options}]