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

Merge pull request #5522 from penpot/ladybenko-fix-render-all-race

🐛 Fix race condition when rendering the background
This commit is contained in:
Aitor Moreno 2025-01-08 14:47:53 +01:00 committed by GitHub
commit 8ef4850a06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -284,8 +284,7 @@
(p/fmap (fn [ready?]
(when ready?
(reset! canvas-init? true)
(wasm.api/assign-canvas canvas)
(wasm.api/set-canvas-background background)))))
(wasm.api/assign-canvas canvas)))))
(fn []
(wasm.api/clear-canvas))))
@ -293,15 +292,15 @@
(when @canvas-init?
(wasm.api/resize-viewbox (:width vport) (:height vport))))
(mf/with-effect [base-objects canvas-init?]
(mf/with-effect [base-objects @canvas-init?]
(when @canvas-init?
(wasm.api/set-objects base-objects)))
(mf/with-effect [preview-blend canvas-init?]
(mf/with-effect [preview-blend @canvas-init?]
(when (and @canvas-init? preview-blend)
(wasm.api/request-render)))
(mf/with-effect [vbox canvas-init?]
(mf/with-effect [vbox @canvas-init?]
(when @canvas-init?
(wasm.api/set-view zoom vbox)))