mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 06:41:37 +02:00
Merge pull request #5522 from penpot/ladybenko-fix-render-all-race
🐛 Fix race condition when rendering the background
This commit is contained in:
commit
8ef4850a06
1 changed files with 4 additions and 5 deletions
|
@ -284,8 +284,7 @@
|
||||||
(p/fmap (fn [ready?]
|
(p/fmap (fn [ready?]
|
||||||
(when ready?
|
(when ready?
|
||||||
(reset! canvas-init? true)
|
(reset! canvas-init? true)
|
||||||
(wasm.api/assign-canvas canvas)
|
(wasm.api/assign-canvas canvas)))))
|
||||||
(wasm.api/set-canvas-background background)))))
|
|
||||||
(fn []
|
(fn []
|
||||||
(wasm.api/clear-canvas))))
|
(wasm.api/clear-canvas))))
|
||||||
|
|
||||||
|
@ -293,15 +292,15 @@
|
||||||
(when @canvas-init?
|
(when @canvas-init?
|
||||||
(wasm.api/resize-viewbox (:width vport) (:height vport))))
|
(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?
|
(when @canvas-init?
|
||||||
(wasm.api/set-objects base-objects)))
|
(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)
|
(when (and @canvas-init? preview-blend)
|
||||||
(wasm.api/request-render)))
|
(wasm.api/request-render)))
|
||||||
|
|
||||||
(mf/with-effect [vbox canvas-init?]
|
(mf/with-effect [vbox @canvas-init?]
|
||||||
(when @canvas-init?
|
(when @canvas-init?
|
||||||
(wasm.api/set-view zoom vbox)))
|
(wasm.api/set-view zoom vbox)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue