From a2fbf93ec1b6f501c0bfedac34fa447cbebaf501 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 7 Jul 2023 11:58:47 +0200 Subject: [PATCH] :bug: Fix problem with importation process --- CHANGES.md | 1 + backend/src/app/rpc/commands/files_temp.clj | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 959130e682..a6cf80ca38 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -50,6 +50,7 @@ - Fix grid not being clipped in frames [#3365](https://github.com/penpot/penpot/issues/3365) - Fix cut/delete text layer when while creating text [Taiga #5602](https://tree.taiga.io/project/penpot/issue/5602) - Fix picking a gradient color in recent colors for a new color in the assets tab [Taiga #5601](https://tree.taiga.io/project/penpot/issue/5601) +- Fix problem with importation process [Taiga #5597](https://tree.taiga.io/project/penpot/issue/5597) ### :arrow_up: Deps updates diff --git a/backend/src/app/rpc/commands/files_temp.clj b/backend/src/app/rpc/commands/files_temp.clj index 4eb24cca26..85902a0faf 100644 --- a/backend/src/app/rpc/commands/files_temp.clj +++ b/backend/src/app/rpc/commands/files_temp.clj @@ -86,16 +86,16 @@ (ex/raise :type :validation :code :cant-persist-already-persisted-file)) - (loop [revs (seq revs) - data (blob/decode (:data file))] - (if-let [rev (first revs)] - (recur (rest revs) - (->> rev :changes blob/decode (cp/process-changes data))) - (db/update! conn :file - {:deleted-at nil - :revn revn - :data (blob/encode data)} - {:id id}))) + + (let [data + (->> revs + (mapcat #(->> % :changes blob/decode)) + (cp/process-changes (blob/decode (:data file))))] + (db/update! conn :file + {:deleted-at nil + :revn revn + :data (blob/encode data)} + {:id id})) nil)) (s/def ::persist-temp-file