0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-22 23:06:08 -05:00

Merge pull request #3039 from penpot/alotor-fix-text-sync

Fix text sync problems
This commit is contained in:
Alejandro 2023-03-14 12:22:14 +01:00 committed by GitHub
commit 4661fb26dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,17 +202,19 @@
(fn [{:keys [type attr]}]
(and (= :set type) (= attr :position-data)))
add-origin-session-id
(fn [{:keys [] :as op}]
(cond-> op
(position-data-operation? op)
(update :val with-meta {:session-id (:session-id msg)})))
;;add-origin-session-id
;;(fn [{:keys [] :as op}]
;; (cond-> op
;; (position-data-operation? op)
;; (update :val with-meta {:session-id (:session-id msg)})))
update-position-data
(fn [change]
;; Remove the position data from remote operations. Will be changed localy, otherwise
;; creates a strange "out-of-sync" behaviour.
(cond-> change
(= :mod-obj (:type change))
(update :operations #(mapv add-origin-session-id %))))
(update :operations #(d/removev position-data-operation? %))))
process-page-changes
(fn [[page-id changes]]