0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 05:34:23 -05:00

🐛 Fix export crash when there's no tokens in the project

This commit is contained in:
Andrey Fedorov 2024-12-11 13:18:48 +01:00
parent 2a766a7190
commit 90e0021cec

View file

@ -323,12 +323,12 @@
:timeout 9000})))))
(set! (.-value (mf/ref-val input-ref)) "")))
on-export (fn []
(let [tokens-blob (some-> (deref refs/tokens-lib)
(let [tokens-json (some-> (deref refs/tokens-lib)
(ctob/encode-dtcg)
(clj->js)
(js/JSON.stringify nil 2)
(wapi/create-blob "application/json"))]
(dom/trigger-download "tokens.json" tokens-blob)))]
(js/JSON.stringify nil 2))]
(->> (wapi/create-blob (or tokens-json "{}") "application/json")
(dom/trigger-download "tokens.json"))))]
[:div {:class (stl/css :import-export-button-wrapper)}
[:input {:type "file"