From c16a116707caa6855686dde95383b922c4858726 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 1 Oct 2024 11:57:52 +0200 Subject: [PATCH] :sparkles: Modifications after review --- frontend/src/app/main/data/plugins.cljs | 7 ++++--- frontend/src/app/main/ui/routes.cljs | 9 ++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/main/data/plugins.cljs b/frontend/src/app/main/data/plugins.cljs index b970bfe2d..d20e65727 100644 --- a/frontend/src/app/main/data/plugins.cljs +++ b/frontend/src/app/main/data/plugins.cljs @@ -7,13 +7,15 @@ (ns app.main.data.plugins (:require [app.plugins.register :as pr] + [app.util.globals :as ug] + [beicon.v2.core :as rx] [potok.v2.core :as ptk])) (defn open-plugin! [{:keys [plugin-id name description host code icon permissions]}] (try (.ɵloadPlugin - js/window + ^js ug/global #js {:pluginId plugin-id :name name :description description @@ -38,5 +40,4 @@ (watch [_ state _] (when-let [pid (::open-plugin state)] (open-plugin! (pr/get-plugin pid)) - (fn [state] - (dissoc state ::open-plugin)))))) + (rx/of #(dissoc % ::open-plugin)))))) diff --git a/frontend/src/app/main/ui/routes.cljs b/frontend/src/app/main/ui/routes.cljs index 782ac5526..a43038b73 100644 --- a/frontend/src/app/main/ui/routes.cljs +++ b/frontend/src/app/main/ui/routes.cljs @@ -8,6 +8,7 @@ (:require [app.common.data.macros :as dm] [app.common.spec :as us] + [app.common.uri :as u] [app.common.uuid :as uuid] [app.config :as cf] [app.main.data.users :as du] @@ -96,12 +97,6 @@ [router path] (let [location (.-location js/document) [base-path qs] (str/split path "?") - - qstring - (->> (str/split qs "&") - (map #(str/split % "=")) - (into {})) - location-path (dm/str (.-origin location) (.-pathname location)) valid-location? (= location-path (dm/str cf/public-uri)) match (match-path router path) @@ -124,7 +119,7 @@ (st/emit! (rt/nav :auth-login)) empty-path? - (st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)} qstring)) + (st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)} (u/query-string->map qs))) :else (st/emit! (rt/assign-exception {:type :not-found})))))))))