mirror of
https://github.com/penpot/penpot.git
synced 2025-06-11 02:01:37 +02:00
⚡ Changes indices to update only necesary data
This commit is contained in:
parent
308fd8d4b0
commit
285a0d5f47
11 changed files with 382 additions and 219 deletions
|
@ -39,11 +39,15 @@
|
|||
(defmethod handler :update-page-indices
|
||||
[{:keys [page-id changes] :as message}]
|
||||
|
||||
(swap! state ch/process-changes changes false)
|
||||
(let [old-objects (get-in @state [:pages-index page-id :objects])]
|
||||
(swap! state ch/process-changes changes false)
|
||||
|
||||
(let [objects (get-in @state [:pages-index page-id :objects])
|
||||
message (assoc message :objects objects)]
|
||||
(handler (-> message
|
||||
(assoc :cmd :selection/update-index)))
|
||||
(handler (-> message
|
||||
(assoc :cmd :snaps/update-index)))))
|
||||
(let [new-objects (get-in @state [:pages-index page-id :objects])
|
||||
message (assoc message
|
||||
:objects new-objects
|
||||
:new-objects new-objects
|
||||
:old-objects old-objects)]
|
||||
(handler (-> message
|
||||
(assoc :cmd :selection/update-index)))
|
||||
(handler (-> message
|
||||
(assoc :cmd :snaps/update-index))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue