mirror of
https://github.com/penpot/penpot.git
synced 2025-06-09 16:11:38 +02:00
Merge remote-tracking branch 'origin/main' into develop
This commit is contained in:
commit
28e2d64ac6
3 changed files with 10 additions and 4 deletions
|
@ -53,13 +53,13 @@
|
||||||
|
|
||||||
([id params {:keys [raw-transit?]}]
|
([id params {:keys [raw-transit?]}]
|
||||||
(let [decode-transit (if raw-transit?
|
(let [decode-transit (if raw-transit?
|
||||||
identity
|
http/conditional-error-decode-transit
|
||||||
(partial rx/map http/conditional-decode-transit))]
|
http/conditional-decode-transit)]
|
||||||
(->> (http/send! {:method :get
|
(->> (http/send! {:method :get
|
||||||
:uri (u/join base-uri "api/rpc/query/" (name id))
|
:uri (u/join base-uri "api/rpc/query/" (name id))
|
||||||
:credentials "include"
|
:credentials "include"
|
||||||
:query params})
|
:query params})
|
||||||
(decode-transit)
|
(rx/map decode-transit)
|
||||||
(rx/mapcat handle-response)))))
|
(rx/mapcat handle-response)))))
|
||||||
|
|
||||||
(defn- send-mutation!
|
(defn- send-mutation!
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
;; Calculate the data-uris for these fonts
|
;; Calculate the data-uris for these fonts
|
||||||
fonts-embed (embed/use-data-uris fonts-urls)
|
fonts-embed (embed/use-data-uris fonts-urls)
|
||||||
|
|
||||||
loading? (d/seek #(not (contains? fonts-embed %)) fonts-urls)
|
loading? (some? (d/seek #(not (contains? fonts-embed %)) fonts-urls))
|
||||||
|
|
||||||
;; Creates a style tag by replacing the urls with the data uri
|
;; Creates a style tag by replacing the urls with the data uri
|
||||||
style (replace-embeds fonts-css fonts-urls fonts-embed)]
|
style (replace-embeds fonts-css fonts-urls fonts-embed)]
|
||||||
|
|
|
@ -143,6 +143,12 @@
|
||||||
(assoc response :body (t/decode-str body))
|
(assoc response :body (t/decode-str body))
|
||||||
response)))
|
response)))
|
||||||
|
|
||||||
|
(defn conditional-error-decode-transit
|
||||||
|
[{:keys [body status] :as response}]
|
||||||
|
(if (and (>= status 400) (string? body))
|
||||||
|
(assoc response :body (t/decode-str body))
|
||||||
|
response))
|
||||||
|
|
||||||
(defn success?
|
(defn success?
|
||||||
[{:keys [status]}]
|
[{:keys [status]}]
|
||||||
(<= 200 status 299))
|
(<= 200 status 299))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue