0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Fix problem with font loading

This commit is contained in:
alonso.torres 2024-01-09 17:10:12 +01:00 committed by Andrey Antukh
parent a4796e8db8
commit 9c35652043

View file

@ -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))))))