mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 15:39:50 -05:00
🐛 Fix problem with font loading
This commit is contained in:
parent
a4796e8db8
commit
9c35652043
1 changed files with 7 additions and 7 deletions
|
@ -211,7 +211,7 @@
|
||||||
|
|
||||||
;; Font is currently downloading. We attach the caller to the promise
|
;; Font is currently downloading. We attach the caller to the promise
|
||||||
(contains? @loading font-id)
|
(contains? @loading font-id)
|
||||||
(p/resolved (get @loading font-id))
|
(get @loading font-id)
|
||||||
|
|
||||||
;; First caller, we create the promise and then wait
|
;; First caller, we create the promise and then wait
|
||||||
:else
|
:else
|
||||||
|
@ -220,13 +220,13 @@
|
||||||
(swap! loading dissoc font-id)
|
(swap! loading dissoc font-id)
|
||||||
(resolve font-id))
|
(resolve font-id))
|
||||||
|
|
||||||
load-p (->> (p/create
|
load-p (-> (p/create
|
||||||
(fn [resolve _]
|
(fn [resolve _]
|
||||||
(-> font
|
(-> font
|
||||||
(assoc ::on-loaded (partial on-load resolve))
|
(assoc ::on-loaded (partial on-load resolve))
|
||||||
(load-font))))
|
(load-font))))
|
||||||
;; We need to wait for the font to be loaded
|
;; 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)
|
(swap! loading assoc font-id load-p)
|
||||||
load-p))))))
|
load-p))))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue