mirror of
https://github.com/penpot/penpot.git
synced 2025-05-12 05:46:38 +02:00
🐛 Fix duplicate frames
This commit is contained in:
parent
506c2b8d7b
commit
d69d392362
2 changed files with 67 additions and 77 deletions
|
@ -267,6 +267,30 @@
|
|||
[]
|
||||
(dump-selected' @st/state))
|
||||
|
||||
(defn ^:export parent
|
||||
[]
|
||||
(let [state @st/state
|
||||
page-id (get state :current-page-id)
|
||||
objects (get-in state [:workspace-data :pages-index page-id :objects])
|
||||
selected (first (get-in state [:workspace-local :selected]))
|
||||
parent-id (get-in objects [selected :parent-id])
|
||||
parent (get objects parent-id)]
|
||||
(when parent
|
||||
(prn (str (:name parent) " - " (:id parent))))
|
||||
nil))
|
||||
|
||||
(defn ^:export frame
|
||||
[]
|
||||
(let [state @st/state
|
||||
page-id (get state :current-page-id)
|
||||
objects (get-in state [:workspace-data :pages-index page-id :objects])
|
||||
selected (first (get-in state [:workspace-local :selected]))
|
||||
frame-id (get-in objects [selected :frame-id])
|
||||
frame (get objects frame-id)]
|
||||
(when frame
|
||||
(prn (str (:name frame) " - " (:id frame))))
|
||||
nil))
|
||||
|
||||
(defn dump-tree'
|
||||
([state] (dump-tree' state false false))
|
||||
([state show-ids] (dump-tree' state show-ids false))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue