diff --git a/frontend/src/app/main/ui.cljs b/frontend/src/app/main/ui.cljs index 157ae24d9b..f41242f6f6 100644 --- a/frontend/src/app/main/ui.cljs +++ b/frontend/src/app/main/ui.cljs @@ -133,18 +133,21 @@ ::mf/private true} [{:keys [team-id children]}] (mf/with-effect [team-id] - (st/emit! (dtm/initialize-team team-id)) - (fn [] - (st/emit! (dtm/finalize-team team-id)))) + (when (uuid? team-id) + (st/emit! (dtm/initialize-team team-id)) + (fn [] + (st/emit! (dtm/finalize-team team-id))))) - (let [{:keys [permissions] :as team} (mf/deref refs/team)] - (when (= team-id (:id team)) - [:> (mf/provider ctx/current-team-id) {:value team-id} - [:> (mf/provider ctx/permissions) {:value permissions} - [:> (mf/provider ctx/can-edit?) {:value (:can-edit permissions)} - ;; The `:key` is mandatory here because we want to reinitialize - ;; all dom tree instead of simple rerender. - [:* {:key (str team-id)} children]]]]))) + (if-not (uuid? team-id) + nil + (let [{:keys [permissions] :as team} (mf/deref refs/team)] + (when (= team-id (:id team)) + [:> (mf/provider ctx/current-team-id) {:value team-id} + [:> (mf/provider ctx/permissions) {:value permissions} + [:> (mf/provider ctx/can-edit?) {:value (:can-edit permissions)} + ;; The `:key` is mandatory here because we want to reinitialize + ;; all dom tree instead of simple rerender. + [:* {:key (str team-id)} children]]]])))) (mf/defc page* {::mf/props :obj