Merge pull request #4731 from penpot/niwinz-bugfix-6

🐛 Fix many race conditions on thumbnail generation process
This commit is contained in:
Aitor Moreno 2024-06-14 13:15:10 +02:00 committed by GitHub
commit 22ede6b08e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 148 additions and 160 deletions

View file

@ -109,7 +109,7 @@
(fn [{:keys [width height]}]
(when (or (not (mth/close? width fixed-width 5))
(not (mth/close? height fixed-height 5)))
(st/emit! (dwt/request-thumbnail file-id page-id frame-id "frame" "check-thumbnail-size"))))))))
(st/emit! (dwt/update-thumbnail file-id page-id frame-id "frame" "check-thumbnail-size"))))))))
(defn root-frame-wrapper-factory
[shape-wrapper]
@ -176,7 +176,8 @@
(mf/with-effect []
(when-not (some? thumbnail-uri)
(tm/schedule-on-idle
#(st/emit! (dwt/request-thumbnail file-id page-id frame-id "frame" "root-frame"))))
#(st/emit! (dwt/update-thumbnail file-id page-id frame-id "frame" "root-frame"))))
#(when-let [task (mf/ref-val task-ref)]
(d/close! task)))