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:
parent
2a766a7190
commit
90e0021cec
1 changed files with 4 additions and 4 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue