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:
commit
0239139b4b
1 changed files with 12 additions and 8 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue