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

Merge pull request #4802 from penpot/jordisala1991-feature/no-direct-download

 Return blob when exporting using the lib-penpot
This commit is contained in:
Andrey Antukh 2024-06-27 07:59:38 +02:00 committed by GitHub
commit 0239139b4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,13 +12,13 @@
[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]
[app.worker.export :as e]
[beicon.v2.core :as rx]
[cuerdas.core :as str]))
[cuerdas.core :as str]
[promesa.core :as p]))
(defn parse-data [data]
(as-> data $
@ -262,12 +262,16 @@
(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))))))))
(p/create
(fn [resolve reject]
(->> (export-file file)
(rx/take 1)
(rx/subs!
(fn [value]
(when (not (contains? value :type))
(let [[_ export-blob] value]
(resolve export-blob))))
reject))))))
(defn create-file-export [^string name]
(binding [cfeat/*current* cfeat/default-features]