🐛 Fix problems with text synchronization

This commit is contained in:
alonso.torres 2023-03-13 13:09:45 +01:00
parent 4eeef41ed4
commit a56dc25fae

View file

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