🐛 Fix imposters loading rect

This commit is contained in:
Aitor 2024-01-04 10:09:12 +01:00 committed by Alonso Torres
parent a6662f2774
commit a76e5940af

View file

@ -118,12 +118,12 @@
tries-ref (mf/use-ref 0) tries-ref (mf/use-ref 0)
imposter-ref (mf/use-ref nil) imposter-ref (mf/use-ref nil)
imposter-loaded-ref (mf/use-ref false) imposter-loaded (mf/use-state false)
task-ref (mf/use-ref nil) task-ref (mf/use-ref nil)
on-load (mf/use-fn (fn [] on-load (mf/use-fn (fn []
(mf/set-ref-val! tries-ref 0) (mf/set-ref-val! tries-ref 0)
(mf/set-ref-val! imposter-loaded-ref true))) (reset! imposter-loaded true)))
on-error (mf/use-fn on-error (mf/use-fn
(fn [] (fn []
(let [current-tries (mf/ref-val tries-ref) (let [current-tries (mf/ref-val tries-ref)
@ -158,7 +158,7 @@
:opacity (when ^boolean hidden? 0)} :opacity (when ^boolean hidden? 0)}
;; When there is no thumbnail, we generate a empty rect. ;; When there is no thumbnail, we generate a empty rect.
(when (and (not ^boolean content-visible?) (not (mf/ref-val imposter-loaded-ref))) (when (and (not ^boolean content-visible?) (not @imposter-loaded))
[:g.frame-placeholder [:g.frame-placeholder
[:rect {:x x [:rect {:x x
:y y :y y