From a76e5940af73788d1805b3e97ca43f4e5faa99d7 Mon Sep 17 00:00:00 2001 From: Aitor Date: Thu, 4 Jan 2024 10:09:12 +0100 Subject: [PATCH] :bug: Fix imposters loading rect --- frontend/src/app/main/ui/workspace/shapes/frame.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/shapes/frame.cljs b/frontend/src/app/main/ui/workspace/shapes/frame.cljs index 11bf95774..2dc7e3289 100644 --- a/frontend/src/app/main/ui/workspace/shapes/frame.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/frame.cljs @@ -118,12 +118,12 @@ tries-ref (mf/use-ref 0) 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) on-load (mf/use-fn (fn [] (mf/set-ref-val! tries-ref 0) - (mf/set-ref-val! imposter-loaded-ref true))) + (reset! imposter-loaded true))) on-error (mf/use-fn (fn [] (let [current-tries (mf/ref-val tries-ref) @@ -158,7 +158,7 @@ :opacity (when ^boolean hidden? 0)} ;; 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 [:rect {:x x :y y