From f1b536034ad751507f516d832ec2e7364470501e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Mon, 5 Sep 2022 16:05:07 +0200 Subject: [PATCH] :sparkles: Show error instead of dialog --- frontend/src/app/main/data/viewer.cljs | 15 +++++---------- frontend/src/app/util/router.cljs | 5 ++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/main/data/viewer.cljs b/frontend/src/app/main/data/viewer.cljs index 404295f8c..3ee9a55cc 100644 --- a/frontend/src/app/main/data/viewer.cljs +++ b/frontend/src/app/main/data/viewer.cljs @@ -15,10 +15,9 @@ [app.common.types.shape.interactions :as ctsi] [app.main.data.comments :as dcm] [app.main.data.fonts :as df] - [app.main.data.modal :as modal] + [app.main.data.messages :as msg] [app.main.features :as features] [app.main.repo :as rp] - [app.main.store :as st] [app.util.globals :as ug] [app.util.i18n :as i18n :refer [tr]] [app.util.router :as rt] @@ -124,14 +123,10 @@ (->> (rx/of (df/fonts-fetched fonts) (bundle-fetched (merge bundle params)))))) (rx/catch (fn [err] - (let [team-id (-> state :teams keys first)] - (if (and (= (:type err) :restriction) - (= (:code err) :feature-disabled)) - (rx/of (modal/show - {:type :alert - :message (tr "errors.components-v2") - :on-accept #(st/emit! (rt/nav ""))})) - (rx/throw err)))))))))) + (if (and (= (:type err) :restriction) + (= (:code err) :feature-disabled)) + (rx/of (msg/error (tr "errors.components-v2") {:timeout nil})) + (rx/throw err))))))))) (declare go-to-frame-auto) diff --git a/frontend/src/app/util/router.cljs b/frontend/src/app/util/router.cljs index e10a24be2..21a89434c 100644 --- a/frontend/src/app/util/router.cljs +++ b/frontend/src/app/util/router.cljs @@ -27,9 +27,8 @@ ([router id] (resolve router id {} {})) ([router id path-params] (resolve router id path-params {})) ([router id path-params query-params] - (if-let [match (r/match-by-name router id path-params)] - (r/match->path match query-params) - ""))) + (when-let [match (r/match-by-name router id path-params)] + (r/match->path match query-params)))) (defn create [routes]