0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

Merge pull request #4302 from penpot/niwinz-staging-bugfix-1

🐛 Fix release build issue
This commit is contained in:
Alejandro 2024-03-20 16:32:32 +01:00 committed by GitHub
commit 892acecd9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 17 deletions

View file

@ -28,9 +28,7 @@
[app.common.types.shape-tree :as ctst] [app.common.types.shape-tree :as ctst]
[app.common.types.shape.layout :as ctl] [app.common.types.shape.layout :as ctl]
[app.config :as cfg] [app.config :as cfg]
[app.main.features :as features]
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.main.store :as st]
[app.main.ui.context :as muc] [app.main.ui.context :as muc]
[app.main.ui.shapes.bool :as bool] [app.main.ui.shapes.bool :as bool]
[app.main.ui.shapes.circle :as circle] [app.main.ui.shapes.circle :as circle]
@ -46,7 +44,6 @@
[app.main.ui.shapes.svg-raw :as svg-raw] [app.main.ui.shapes.svg-raw :as svg-raw]
[app.main.ui.shapes.text :as text] [app.main.ui.shapes.text :as text]
[app.main.ui.shapes.text.fontfaces :as ff] [app.main.ui.shapes.text.fontfaces :as ff]
[app.main.worker :as wrk]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.http :as http] [app.util.http :as http]
[app.util.strings :as ust] [app.util.strings :as ust]
@ -671,16 +668,3 @@
(do (do
(l/warn :msg "imposter shape is nil") (l/warn :msg "imposter shape is nil")
(rx/empty))))) (rx/empty)))))
(defn render-thumbnail
[file-id revn]
(->> (wrk/ask! {:cmd :thumbnails/generate-for-file
:revn revn
:file-id file-id
:features (features/get-team-enabled-features @st/state)})
(rx/mapcat (fn [{:keys [fonts] :as result}]
(->> (fonts/render-font-styles fonts)
(rx/map (fn [styles]
(assoc result
:styles styles
:width 252))))))))

View file

@ -13,6 +13,7 @@
[app.common.logging :as log] [app.common.logging :as log]
[app.main.data.dashboard :as dd] [app.main.data.dashboard :as dd]
[app.main.data.messages :as msg] [app.main.data.messages :as msg]
[app.main.features :as features]
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.main.rasterizer :as thr] [app.main.rasterizer :as thr]
[app.main.refs :as refs] [app.main.refs :as refs]
@ -26,6 +27,7 @@
[app.main.ui.dashboard.placeholder :refer [empty-placeholder loading-placeholder]] [app.main.ui.dashboard.placeholder :refer [empty-placeholder loading-placeholder]]
[app.main.ui.hooks :as h] [app.main.ui.hooks :as h]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.main.worker :as wrk]
[app.util.color :as uc] [app.util.color :as uc]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.dom.dnd :as dnd] [app.util.dom.dnd :as dnd]
@ -47,10 +49,23 @@
(->> (rp/cmd! :create-file-thumbnail params) (->> (rp/cmd! :create-file-thumbnail params)
(rx/map :uri)))) (rx/map :uri))))
(defn render-thumbnail
[file-id revn]
(->> (wrk/ask! {:cmd :thumbnails/generate-for-file
:revn revn
:file-id file-id
:features (features/get-team-enabled-features @st/state)})
(rx/mapcat (fn [{:keys [fonts] :as result}]
(->> (fonts/render-font-styles fonts)
(rx/map (fn [styles]
(assoc result
:styles styles
:width 252))))))))
(defn- ask-for-thumbnail (defn- ask-for-thumbnail
"Creates some hooks to handle the files thumbnails cache" "Creates some hooks to handle the files thumbnails cache"
[file-id revn] [file-id revn]
(->> (render/render-thumbnail file-id revn) (->> (render-thumbnail file-id revn)
(rx/mapcat thr/render) (rx/mapcat thr/render)
(rx/mapcat (partial persist-thumbnail file-id revn)))) (rx/mapcat (partial persist-thumbnail file-id revn))))