From 0ce99968b3fb9bd895e02182988ea1d63fdc2c3b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 18 Feb 2025 10:53:32 +0100 Subject: [PATCH] :bug: Fix incorrect navigation on show-main-component menu option --- common/src/app/common/types/component.cljc | 2 +- frontend/src/app/main/data/workspace/libraries.cljs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/types/component.cljc b/common/src/app/common/types/component.cljc index b26461f2bb..53b60c454c 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 2cf8ad2924..d61f682359 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}]