0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

Simplify feature handling on get-file

This commit is contained in:
Andrey Antukh 2023-12-15 15:01:50 +01:00
parent 47baa21d53
commit ac20451ae7

View file

@ -224,11 +224,8 @@
(defn- migrate-file (defn- migrate-file
[{:keys [::db/conn] :as cfg} {:keys [id] :as file}] [{:keys [::db/conn] :as cfg} {:keys [id] :as file}]
(binding [pmap/*load-fn* (partial feat.fdata/load-pointer cfg id) (binding [pmap/*load-fn* (partial feat.fdata/load-pointer cfg id)
pmap/*tracked* (pmap/create-tracked) pmap/*tracked* (pmap/create-tracked)]
cfeat/*new* (atom #{})] (let [file (fmg/migrate-file file)]
(let [file (-> (fmg/migrate-file file)
(update :features into (deref cfeat/*new*))
(update :features cfeat/migrate-legacy-features))]
;; NOTE: when file is migrated, we break the rule of no perform ;; NOTE: when file is migrated, we break the rule of no perform
;; mutations on get operations and update the file with all ;; mutations on get operations and update the file with all