0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

💩 Comment some code that needs to be refactored (undo related).

This commit is contained in:
Andrey Antukh 2019-08-24 15:58:52 +02:00
parent f99134c70b
commit 902f7c4181

View file

@ -21,7 +21,8 @@
(deftype WatchPageChanges [id] (deftype WatchPageChanges [id]
ptk/WatchEvent ptk/WatchEvent
(watch [_ state stream] (watch [_ state stream]
(let [stopper (->> stream nil
#_(let [stopper (->> stream
(rx/filter #(= % ::udp/stop-page-watcher)) (rx/filter #(= % ::udp/stop-page-watcher))
(rx/take 1))] (rx/take 1))]
(->> stream (->> stream
@ -41,7 +42,8 @@
(defrecord SaveUndoEntry [id] (defrecord SaveUndoEntry [id]
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [page (udp/pack-page state id) state
#_(let [page (udp/pack-page state id)
undo {:data (:data page) undo {:data (:data page)
:metadata (:metadata page)}] :metadata (:metadata page)}]
(-> state (-> state
@ -88,7 +90,7 @@
udp/IPageUpdate udp/IPageUpdate
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [page-id (get-in state [:workspace :page]) #_(let [page-id (get-in state [:workspace :page])
undo-state (get-in state [:undo page-id]) undo-state (get-in state [:undo page-id])
stack (:stack undo-state) stack (:stack undo-state)
selected (:selected undo-state 0)] selected (:selected undo-state 0)]
@ -123,7 +125,7 @@
udp/IPageUpdate udp/IPageUpdate
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [page-id (get-in state [:workspace :page]) #_(let [page-id (get-in state [:workspace :page])
undo-state (get-in state [:undo page-id]) undo-state (get-in state [:undo page-id])
stack (:stack undo-state) stack (:stack undo-state)
selected (:selected undo-state)] selected (:selected undo-state)]