0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

Return blob when exporting using the lib-penpot

This commit is contained in:
Jordi Sala Morales 2024-06-06 12:40:29 +00:00 committed by Andrey Antukh
parent 4ed6e1e8ec
commit 44b6d1a516

View file

@ -12,7 +12,6 @@
[app.common.media :as cm]
[app.common.types.components-list :as ctkl]
[app.common.uuid :as uuid]
[app.util.dom :as dom]
[app.util.json :as json]
[app.util.webapi :as wapi]
[app.util.zip :as uz]
@ -262,12 +261,14 @@
(uuid/next))
(export [_]
(->> (export-file file)
(rx/subs!
(fn [value]
(when (not (contains? value :type))
(let [[file export-blob] value]
(dom/trigger-download (:name file) export-blob))))))))
(js/Promise.
(fn [resolve _reject]
(-> (export-file file)
(rx/subscribe
(fn [value]
(when (not (contains? value :type))
(let [[_ export-blob] value]
(resolve export-blob))))))))))
(defn create-file-export [^string name]
(binding [cfeat/*current* cfeat/default-features]