mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 16:21:38 +02:00
🐛 Clean legacy features on binfile (v1) importation
This commit is contained in:
parent
c336cbe8ab
commit
39cb4a081b
1 changed files with 10 additions and 0 deletions
|
@ -517,6 +517,15 @@
|
||||||
(update :object-id #(str/replace-first % #"^(.*?)/" (str file-id "/")))))
|
(update :object-id #(str/replace-first % #"^(.*?)/" (str file-id "/")))))
|
||||||
thumbnails))
|
thumbnails))
|
||||||
|
|
||||||
|
(defn- clean-features
|
||||||
|
[file]
|
||||||
|
(update file :features (fn [features]
|
||||||
|
(if (set? features)
|
||||||
|
(-> features
|
||||||
|
(cfeat/migrate-legacy-features)
|
||||||
|
(set/difference cfeat/backend-only-features))
|
||||||
|
#{}))))
|
||||||
|
|
||||||
(defmethod read-section :v1/files
|
(defmethod read-section :v1/files
|
||||||
[{:keys [::db/conn ::input ::project-id ::bfc/overwrite ::name] :as system}]
|
[{:keys [::db/conn ::input ::project-id ::bfc/overwrite ::name] :as system}]
|
||||||
|
|
||||||
|
@ -527,6 +536,7 @@
|
||||||
file-id (:id file)
|
file-id (:id file)
|
||||||
file-id' (bfc/lookup-index file-id)
|
file-id' (bfc/lookup-index file-id)
|
||||||
|
|
||||||
|
file (clean-features file)
|
||||||
thumbnails (:thumbnails file)]
|
thumbnails (:thumbnails file)]
|
||||||
|
|
||||||
(when (not= file-id expected-file-id)
|
(when (not= file-id expected-file-id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue