mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix regression on subpath support (#8793)
This commit is contained in:
parent
0dfa62a5b6
commit
6db3c6cf89
@ -9,6 +9,10 @@ localhost:3449 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
http://localhost:3450 {
|
http://localhost:3450 {
|
||||||
|
# For subpath test
|
||||||
|
# handle_path /penpot/* {
|
||||||
|
# reverse_proxy localhost:4449
|
||||||
|
# }
|
||||||
reverse_proxy localhost:4449
|
reverse_proxy localhost:4449
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -179,12 +179,11 @@
|
|||||||
([media]
|
([media]
|
||||||
(resolve-file-media media false))
|
(resolve-file-media media false))
|
||||||
([{:keys [id data-uri] :as media} thumbnail?]
|
([{:keys [id data-uri] :as media} thumbnail?]
|
||||||
(if data-uri
|
(or data-uri
|
||||||
data-uri
|
(dm/str
|
||||||
(dm/str
|
(cond-> (u/join public-uri "assets/by-file-media-id/")
|
||||||
(cond-> (u/join public-uri "assets/by-file-media-id/")
|
(true? thumbnail?) (u/join (dm/str id "/thumbnail"))
|
||||||
(true? thumbnail?) (u/join (dm/str id "/thumbnail"))
|
(false? thumbnail?) (u/join (dm/str id)))))))
|
||||||
(false? thumbnail?) (u/join (dm/str id)))))))
|
|
||||||
|
|
||||||
(defn resolve-href
|
(defn resolve-href
|
||||||
[resource]
|
[resource]
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
(:require-macros [app.main.style :as stl])
|
(:require-macros [app.main.style :as stl])
|
||||||
(:require
|
(:require
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
|
[app.common.uri :as u]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.main.data.common :as dcm]
|
[app.main.data.common :as dcm]
|
||||||
[app.main.data.dashboard :as dd]
|
[app.main.data.dashboard :as dd]
|
||||||
@ -95,8 +96,8 @@
|
|||||||
(mf/defc card-item
|
(mf/defc card-item
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[{:keys [item index is-visible collapsed on-import]}]
|
[{:keys [item index is-visible collapsed on-import]}]
|
||||||
(let [id (dm/str "card-container-" index)
|
(let [id (dm/str "card-container-" index)
|
||||||
thb (assoc cf/public-uri :path (dm/str "/images/thumbnails/template-" (:id item) ".jpg"))
|
href (u/join cf/public-uri (dm/str "images/thumbnails/template-" (:id item) ".jpg"))
|
||||||
hover? (mf/use-state false)
|
hover? (mf/use-state false)
|
||||||
|
|
||||||
on-click
|
on-click
|
||||||
@ -124,7 +125,7 @@
|
|||||||
:on-mouse-leave #(reset! hover? false)
|
:on-mouse-leave #(reset! hover? false)
|
||||||
:on-key-down on-key-down}
|
:on-key-down on-key-down}
|
||||||
[:div {:class (stl/css :img-container)}
|
[:div {:class (stl/css :img-container)}
|
||||||
[:img {:src (dm/str thb)
|
[:img {:src (dm/str href)
|
||||||
:alt (:name item)
|
:alt (:name item)
|
||||||
:loading "lazy"
|
:loading "lazy"
|
||||||
:decoding "async"}]]
|
:decoding "async"}]]
|
||||||
|
|||||||
@ -152,7 +152,7 @@
|
|||||||
[font-id font-variant-id font-weight font-style]
|
[font-id font-variant-id font-weight font-style]
|
||||||
(let [variant (font-db-data font-id font-variant-id font-weight font-style)]
|
(let [variant (font-db-data font-id font-variant-id font-weight font-style)]
|
||||||
(if-let [ttf-url (:ttf-url variant)]
|
(if-let [ttf-url (:ttf-url variant)]
|
||||||
(str/replace ttf-url "https://fonts.gstatic.com/s/" (u/join cf/public-uri "/internal/gfonts/font/"))
|
(str/replace ttf-url "https://fonts.gstatic.com/s/" (u/join cf/public-uri "internal/gfonts/font/"))
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(defn- font-id->ttf-url
|
(defn- font-id->ttf-url
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user