🔥 Remove deprecated event from routr ns.

This commit is contained in:
Andrey Antukh 2021-10-05 13:35:10 +02:00 committed by Andrés Moya
parent 9c1c755836
commit ee9b7166a6
3 changed files with 14 additions and 25 deletions

View file

@ -517,11 +517,13 @@
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
(let [file (get-in state [:workspace-libraries file-id]) (let [file (get-in state [:workspace-libraries file-id])
pparams {:project-id (:project-id file) path-params {:project-id (:project-id file)
:file-id (:id file)} :file-id (:id file)}
qparams {:page-id (first (get-in file [:data :pages])) query-params {:page-id (first (get-in file [:data :pages]))
:layout :assets}] :layout :assets}]
(rx/of (rt/nav-new-window :workspace pparams qparams)))))) (rx/of (rt/nav-new-window* {:rname :workspace
:path-params path-params
:query-params query-params}))))))
(defn ext-library-changed (defn ext-library-changed
[file-id modified-at revn changes] [file-id modified-at revn changes]

View file

@ -74,10 +74,12 @@
on-new-tab on-new-tab
(fn [_] (fn [_]
(let [pparams {:project-id (:project-id file) (let [path-params {:project-id (:project-id file)
:file-id (:id file)} :file-id (:id file)}
qparams {:page-id (first (get-in file [:data :pages]))}] query-params {:page-id (first (get-in file [:data :pages]))}]
(st/emit! (rt/nav-new-window :workspace pparams qparams)))) (st/emit! (rt/nav-new-window* {:rname :workspace
:path-params path-params
:query-params query-params}))))
on-duplicate on-duplicate
(fn [_] (fn [_]

View file

@ -110,21 +110,6 @@
(def navigate nav) (def navigate nav)
(deftype NavigateNewWindow [id path-params query-params]
ptk/EffectEvent
(effect [_ state _]
(let [router (:router state)
path (resolve router id path-params query-params)
uri (-> (u/uri cfg/public-uri)
(assoc :fragment path))
name (str (name id) "-" (:file-id path-params))]
(dom/open-new-window (str uri) name))))
(defn nav-new-window
([id] (nav-new-window id nil nil))
([id path-params] (nav-new-window id path-params nil))
([id path-params query-params] (NavigateNewWindow. id path-params query-params)))
(defn nav-new-window* (defn nav-new-window*
[{:keys [rname path-params query-params name]}] [{:keys [rname path-params query-params name]}]
(ptk/reify ::nav-new-window (ptk/reify ::nav-new-window