0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 17:21:17 -05:00

🔥 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

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

View file

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

View file

@ -110,21 +110,6 @@
(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*
[{:keys [rname path-params query-params name]}]
(ptk/reify ::nav-new-window