mirror of
https://github.com/penpot/penpot.git
synced 2026-09-08 21:19:49 +00:00
🐛 Fix incorrect handling of assign operation on changes protocol
This commit is contained in:
parent
c0c8390a7d
commit
f052e31ff0
@ -1091,21 +1091,23 @@
|
|||||||
|
|
||||||
;; === Operations
|
;; === Operations
|
||||||
|
|
||||||
(def ^:private decode-shape
|
(def decode-shape-attrs
|
||||||
(sm/decoder cts/schema:shape sm/json-transformer))
|
(sm/decoder cts/schema:shape-attrs sm/json-transformer))
|
||||||
|
|
||||||
(defmethod process-operation :assign
|
(defmethod process-operation :assign
|
||||||
[{:keys [type] :as shape} {:keys [value] :as op}]
|
[{:keys [type] :as shape} {:keys [value] :as op}]
|
||||||
(let [modifications (assoc value :type type)
|
(let [modifications (assoc value :type type)
|
||||||
modifications (decode-shape modifications)]
|
modifications (decode-shape-attrs modifications)]
|
||||||
(reduce-kv (fn [shape k v]
|
(reduce-kv (fn [shape k v]
|
||||||
(process-operation shape {:type :set
|
(if (not= v (get shape k))
|
||||||
:attr k
|
(process-operation shape {:type :set
|
||||||
:val v
|
:attr k
|
||||||
:ignore-touched (:ignore-touched op)
|
:val v
|
||||||
:ignore-geometry (:ignore-geometry op)}))
|
:ignore-touched (:ignore-touched op)
|
||||||
|
:ignore-geometry (:ignore-geometry op)})
|
||||||
|
shape))
|
||||||
shape
|
shape
|
||||||
modifications)))
|
(dissoc modifications :type))))
|
||||||
|
|
||||||
(defmethod process-operation :set
|
(defmethod process-operation :set
|
||||||
[shape op]
|
[shape op]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user