🐛 Fix font loading on viewer app.

This commit is contained in:
Andrey Antukh 2021-06-04 13:33:50 +02:00 committed by Alonso Torres
parent 8c68e29bf3
commit 8a700170b0
2 changed files with 11 additions and 2 deletions

View file

@ -50,9 +50,14 @@
libs (files/retrieve-file-libraries conn false file-id) libs (files/retrieve-file-libraries conn false file-id)
users (teams/retrieve-users conn (:team-id project)) users (teams/retrieve-users conn (:team-id project))
fonts (db/query conn :team-font-variant
{:team-id (:team-id project)
:deleted-at nil})
bundle {:file file bundle {:file file
:page page :page page
:users users :users users
:fonts fonts
:project project :project project
:libraries libs}] :libraries libs}]

View file

@ -12,9 +12,10 @@
[app.common.spec :as us] [app.common.spec :as us]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.main.constants :as c] [app.main.constants :as c]
[app.main.data.comments :as dcm]
[app.main.data.fonts :as df]
[app.main.repo :as rp] [app.main.repo :as rp]
[app.main.store :as st] [app.main.store :as st]
[app.main.data.comments :as dcm]
[app.util.avatars :as avatars] [app.util.avatars :as avatars]
[app.util.router :as rt] [app.util.router :as rt]
[beicon.core :as rx] [beicon.core :as rx]
@ -97,7 +98,10 @@
:file-id file-id} :file-id file-id}
(string? token) (assoc :token token))] (string? token) (assoc :token token))]
(->> (rp/query :viewer-bundle params) (->> (rp/query :viewer-bundle params)
(rx/map bundle-fetched)))))) (rx/mapcat
(fn [{:keys [fonts] :as bundle}]
(rx/of (df/fonts-fetched fonts)
(bundle-fetched bundle)))))))))
(defn- extract-frames (defn- extract-frames
[objects] [objects]