From 44b6d1a5160f470b0e659378eaf34fb1508af2d8 Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Thu, 6 Jun 2024 12:40:29 +0000 Subject: [PATCH] :sparkles: Return blob when exporting using the lib-penpot --- frontend/src/app/libs/file_builder.cljs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/libs/file_builder.cljs b/frontend/src/app/libs/file_builder.cljs index 63df0eb87..50ce20bf8 100644 --- a/frontend/src/app/libs/file_builder.cljs +++ b/frontend/src/app/libs/file_builder.cljs @@ -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]