0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 18:48:37 -05:00

🐛 Fix problem with export

This commit is contained in:
alonso.torres 2021-10-28 17:56:51 +02:00
parent 30cd499014
commit 7c5d00f8a4

View file

@ -20,22 +20,15 @@
(defn request-export (defn request-export
[shape exports] [shape exports]
(let [result-stream ;; Force a persist before exporting otherwise the exported shape could be outdated
(->> st/stream (st/emit! ::dwp/force-persist)
(rx/filter dwp/shapes-persited-event?) (rp/query!
(rx/take 1) :export
(rx/flat-map {:page-id (:page-id shape)
#(rp/query! :file-id (:file-id shape)
:export :object-id (:id shape)
{:page-id (:page-id shape) :name (:name shape)
:file-id (:file-id shape) :exports exports}))
:object-id (:id shape)
:name (:name shape)
:exports exports})))]
;; Force a persist before exporting otherwise the exported shape could be outdated
(st/emit! ::dwp/force-persist)
result-stream))
(mf/defc exports-menu (mf/defc exports-menu
[{:keys [shape page-id file-id] :as props}] [{:keys [shape page-id file-id] :as props}]