From 9c35652043e7d6946f3d1430aba699bf77c92ded Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 9 Jan 2024 17:10:12 +0100 Subject: [PATCH] :bug: Fix problem with font loading --- frontend/src/app/main/fonts.cljs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/fonts.cljs b/frontend/src/app/main/fonts.cljs index b6c8b2bf1..f934966d9 100644 --- a/frontend/src/app/main/fonts.cljs +++ b/frontend/src/app/main/fonts.cljs @@ -211,7 +211,7 @@ ;; Font is currently downloading. We attach the caller to the promise (contains? @loading font-id) - (p/resolved (get @loading font-id)) + (get @loading font-id) ;; First caller, we create the promise and then wait :else @@ -220,13 +220,13 @@ (swap! loading dissoc font-id) (resolve font-id)) - load-p (->> (p/create - (fn [resolve _] - (-> font - (assoc ::on-loaded (partial on-load resolve)) - (load-font)))) + load-p (-> (p/create + (fn [resolve _] + (-> font + (assoc ::on-loaded (partial on-load resolve)) + (load-font)))) ;; We need to wait for the font to be loaded - (p/delay 120))] + (p/then (partial p/delay 120)))] (swap! loading assoc font-id load-p) load-p))))))