0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-25 22:21:44 -05:00

🔥 Remove unused change event impl (:mov-obj).

This commit is contained in:
Andrey Antukh 2020-04-16 08:45:30 +02:00
parent b3770963b0
commit 953b3caf3d

View file

@ -149,10 +149,6 @@
(s/keys :req-un [::id]
:opt-un [::session-id]))
(defmethod change-spec-impl :mov-obj [_]
(s/keys :req-un [::id ::frame-id]
:opt-un [::session-id]))
(defmethod change-spec-impl :mov-objects [_]
(s/keys :req-un [::parent-id ::shapes]
:opt-un [::index]))
@ -228,16 +224,6 @@
(assoc objects id (reduce process-operation obj operations))
objects))))
(defmethod process-change :mov-obj
[data {:keys [id frame-id] :as change}]
(assert (contains? (:objects data) frame-id))
(let [frame-id' (get-in data [:objects id :frame-id])]
(when (not= frame-id frame-id')
(-> data
(update-in [:objects frame-id' :shapes] (fn [s] (filterv #(not= % id) s)))
(update-in [:objects id] assoc :frame-id frame-id)
(update-in [:objects frame-id :shapes] conj id)))))
(defmethod process-change :del-obj
[data {:keys [id] :as change}]
(when-let [{:keys [frame-id shapes] :as obj} (get-in data [:objects id])]