mirror of
https://github.com/penpot/penpot.git
synced 2025-05-07 20:45:53 +02:00
🐛 Fix sometimes sync of adding/removing shapes fails
This commit is contained in:
parent
fa90403d84
commit
6a5d9402d5
1 changed files with 12 additions and 7 deletions
|
@ -1070,13 +1070,18 @@
|
||||||
(= ::watch-component-changes (ptk/type %)))))
|
(= ::watch-component-changes (ptk/type %)))))
|
||||||
|
|
||||||
workspace-data-s
|
workspace-data-s
|
||||||
|
(->> (rx/from-atom refs/workspace-data {:emit-current-value? true})
|
||||||
|
(rx/share))
|
||||||
|
|
||||||
|
workspace-buffer-s
|
||||||
(->> (rx/concat
|
(->> (rx/concat
|
||||||
(rx/of nil)
|
(rx/take 1 workspace-data-s)
|
||||||
(rx/from-atom refs/workspace-data {:emit-current-value? true}))
|
(rx/take 1 workspace-data-s)
|
||||||
|
workspace-data-s)
|
||||||
;; Need to get the file data before the change, so deleted shapes
|
;; Need to get the file data before the change, so deleted shapes
|
||||||
;; still exist, for example
|
;; still exist, for example. We initialize the buffer with three
|
||||||
(rx/buffer 3 1)
|
;; copies of the initial state
|
||||||
(rx/filter (fn [[old-data]] (some? old-data))))
|
(rx/buffer 3 1))
|
||||||
|
|
||||||
changes-s
|
changes-s
|
||||||
(->> stream
|
(->> stream
|
||||||
|
@ -1106,7 +1111,7 @@
|
||||||
|
|
||||||
changes-s
|
changes-s
|
||||||
(->> changes-s
|
(->> changes-s
|
||||||
(rx/with-latest-from workspace-data-s)
|
(rx/with-latest-from workspace-buffer-s)
|
||||||
(rx/mapcat check-changes)
|
(rx/mapcat check-changes)
|
||||||
(rx/share))
|
(rx/share))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue