mirror of
https://github.com/penpot/penpot.git
synced 2025-06-20 16:07:01 +02:00
🐛 Add script for fix files with bad shape-ref
This commit is contained in:
parent
228b09c340
commit
1bb3a3a084
5 changed files with 90 additions and 20 deletions
|
@ -2291,7 +2291,6 @@
|
|||
;; Components
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
(defn find-components-norefs
|
||||
[]
|
||||
(ptk/reify ::find-components-norefs
|
||||
|
@ -2300,7 +2299,8 @@
|
|||
(let [objects (wsh/lookup-page-objects state)
|
||||
copies (->> objects
|
||||
vals
|
||||
(filter #(and (:component-root %) (not (:main-instance %)))))
|
||||
(filter #(and (ctk/instance-head? %) (not (ctk/main-instance? %)))))
|
||||
|
||||
copies-no-ref (filter #(not (:shape-ref %)) copies)
|
||||
find-childs-no-ref (fn [acc-map item]
|
||||
(let [id (:id item)
|
||||
|
@ -2313,8 +2313,8 @@
|
|||
find-childs-no-ref
|
||||
{}
|
||||
copies)]
|
||||
(js/console.log "Copies no ref" (clj->js copies-no-ref))
|
||||
(js/console.log "Childs no ref" (clj->js childs-no-ref))))))
|
||||
(js/console.log "Copies no ref" (count copies-no-ref) (clj->js copies-no-ref))
|
||||
(js/console.log "Childs no ref" (count childs-no-ref) (clj->js childs-no-ref))))))
|
||||
|
||||
(defn set-shape-ref
|
||||
[id shape-ref]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue