mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 00:37:15 +02:00
♻️ Refactor plugins proxies internal data
This commit is contained in:
parent
b59dae57ca
commit
d6de1fdbdf
7 changed files with 454 additions and 429 deletions
|
@ -23,17 +23,18 @@
|
|||
(if (and (identical? old-file new-file)
|
||||
(identical? old-data new-data))
|
||||
::not-changed
|
||||
(file/data->file-proxy new-file new-data))))
|
||||
(file/file-proxy (:id new-file)))))
|
||||
|
||||
(defmethod handle-state-change "pagechange"
|
||||
[_ old-val new-val]
|
||||
(let [old-page-id (:current-page-id old-val)
|
||||
(let [file-id (:current-file-id new-val)
|
||||
old-page-id (:current-page-id old-val)
|
||||
new-page-id (:current-page-id new-val)
|
||||
old-page (dm/get-in old-val [:workspace-data :pages-index old-page-id])
|
||||
new-page (dm/get-in new-val [:workspace-data :pages-index new-page-id])]
|
||||
(if (identical? old-page new-page)
|
||||
::not-changed
|
||||
(page/data->page-proxy new-page))))
|
||||
(page/page-proxy file-id new-page-id))))
|
||||
|
||||
(defmethod handle-state-change "selectionchange"
|
||||
[_ old-val new-val]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue