mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
🔧 Wait for first render using a custom event (visual regression tests)
This commit is contained in:
parent
59a4b51d2c
commit
1a10b7ebfd
4 changed files with 25 additions and 14 deletions
|
@ -766,13 +766,17 @@
|
|||
|
||||
(defn process-pending
|
||||
[pending]
|
||||
(when-let [pending (-> (d/index-by :key :callback pending) vals)]
|
||||
(->> (rx/from pending)
|
||||
(rx/mapcat (fn [callback] (callback)))
|
||||
(rx/reduce conj [])
|
||||
(rx/subs! (fn [_]
|
||||
(clear-drawing-cache)
|
||||
(request-render "set-objects"))))))
|
||||
(let [event (js/CustomEvent. "wasm:set-objects-finished")
|
||||
pending (-> (d/index-by :key :callback pending) vals)]
|
||||
(if (not-empty? pending)
|
||||
(->> (rx/from pending)
|
||||
(rx/mapcat (fn [callback] (callback)))
|
||||
(rx/reduce conj [])
|
||||
(rx/subs! (fn [_]
|
||||
(clear-drawing-cache)
|
||||
(request-render "set-objects")
|
||||
(.dispatchEvent ^js js/document event))))
|
||||
(.dispatchEvent ^js js/document event))))
|
||||
|
||||
(defn process-object
|
||||
[shape]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue