mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
🐛 Fix incorrect arguments to process-changes
This commit is contained in:
parent
4442246e08
commit
3b61a7dd91
1 changed files with 19 additions and 16 deletions
|
@ -216,29 +216,32 @@
|
||||||
[file-id {:keys [revn changes] :as params}]
|
[file-id {:keys [revn changes] :as params}]
|
||||||
(us/verify! ::us/uuid file-id)
|
(us/verify! ::us/uuid file-id)
|
||||||
(us/verify! ::shapes-changes-persisted params)
|
(us/verify! ::shapes-changes-persisted params)
|
||||||
(ptk/reify ::changes-persisted
|
(ptk/reify ::shapes-changes-persisted
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
;; NOTE: we don't set the file features context here because
|
;; NOTE: we don't set the file features context here because
|
||||||
;; there are no useful context for code that need to be executed
|
;; there are no useful context for code that need to be executed
|
||||||
;; on the frontend side
|
;; on the frontend side
|
||||||
(let [changes (group-by :page-id changes)]
|
|
||||||
(if (= file-id (:current-file-id state))
|
(if-let [current-file-id (:current-file-id state)]
|
||||||
(-> state
|
(if (= file-id current-file-id)
|
||||||
(update-in [:workspace-file :revn] max revn)
|
(let [changes (group-by :page-id changes)]
|
||||||
(update :workspace-data (fn [file]
|
(-> state
|
||||||
(loop [fdata file
|
(update-in [:workspace-file :revn] max revn)
|
||||||
entries (seq changes)]
|
(update :workspace-data (fn [file]
|
||||||
(if-let [[page-id changes] (first entries)]
|
(loop [fdata file
|
||||||
(recur (-> fdata
|
entries (seq changes)]
|
||||||
(cp/process-changes changes)
|
(if-let [[page-id changes] (first entries)]
|
||||||
(ctst/update-object-indices page-id))
|
(recur (-> fdata
|
||||||
(rest entries))
|
(cp/process-changes changes)
|
||||||
fdata)))))
|
(ctst/update-object-indices page-id))
|
||||||
|
(rest entries))
|
||||||
|
fdata))))))
|
||||||
(-> state
|
(-> state
|
||||||
(update-in [:workspace-libraries file-id :revn] max revn)
|
(update-in [:workspace-libraries file-id :revn] max revn)
|
||||||
(update-in [:workspace-libraries file-id :data]
|
(update-in [:workspace-libraries file-id :data] cp/process-changes changes)))
|
||||||
cp/process-changes changes)))))))
|
|
||||||
|
state))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue