0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-02 04:19:08 -05:00

🐛 Fix grid not syncing in multi user

This commit is contained in:
Alejandro Alonso 2022-10-13 13:04:46 +02:00 committed by Eva
parent 4b52612682
commit 87d323bb4c
2 changed files with 19 additions and 8 deletions

View file

@ -43,6 +43,7 @@
- Fix components marked as touched when moved [Taiga #4061](https://tree.taiga.io/project/penpot/task/4061) - Fix components marked as touched when moved [Taiga #4061](https://tree.taiga.io/project/penpot/task/4061)
- Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) - Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251)
- Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298) - Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298)
- Fix grid not syncing immediately in multiuser [Taiga #4339](https://tree.taiga.io/project/penpot/issue/4339)
### :arrow_up: Deps updates ### :arrow_up: Deps updates
### :heart: Community contributions by (Thank you!) ### :heart: Community contributions by (Thank you!)

View file

@ -12,6 +12,7 @@
[app.common.pages.changes-spec :as pcs] [app.common.pages.changes-spec :as pcs]
[app.common.spec :as us] [app.common.spec :as us]
[app.common.types.file :as ctf] [app.common.types.file :as ctf]
[app.common.types.shape-tree :as ctst]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.config :as cf] [app.config :as cf]
[app.main.data.dashboard :as dd] [app.main.data.dashboard :as dd]
@ -219,14 +220,23 @@
(ptk/reify ::changes-persisted (ptk/reify ::changes-persisted
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(if (= file-id (:current-file-id state)) (let [changes (group-by :page-id changes)]
(-> state (if (= file-id (:current-file-id state))
(update-in [:workspace-file :revn] max revn) (-> state
(update :workspace-data cp/process-changes changes)) (update-in [:workspace-file :revn] max revn)
(-> state (update :workspace-data (fn [file]
(update-in [:workspace-libraries file-id :revn] max revn) (loop [fdata file
(update-in [:workspace-libraries file-id :data] entries (seq changes)]
cp/process-changes changes)))))) (if-let [[page-id changes] (first entries)]
(recur (-> fdata
(cp/process-changes changes)
(ctst/update-object-indices page-id))
(rest entries))
fdata)))))
(-> state
(update-in [:workspace-libraries file-id :revn] max revn)
(update-in [:workspace-libraries file-id :data]
cp/process-changes changes)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;