mirror of
https://github.com/penpot/penpot.git
synced 2025-01-20 13:42:59 -05:00
Merge pull request #384 from tokens-studio/andrei/369-export-on-file-without-tokens-crashes
🐛 Export on file without tokens crashes [WIP]
This commit is contained in:
commit
a7c59bb413
1 changed files with 4 additions and 4 deletions
|
@ -323,12 +323,12 @@
|
||||||
:timeout 9000})))))
|
:timeout 9000})))))
|
||||||
(set! (.-value (mf/ref-val input-ref)) "")))
|
(set! (.-value (mf/ref-val input-ref)) "")))
|
||||||
on-export (fn []
|
on-export (fn []
|
||||||
(let [tokens-blob (some-> (deref refs/tokens-lib)
|
(let [tokens-json (some-> (deref refs/tokens-lib)
|
||||||
(ctob/encode-dtcg)
|
(ctob/encode-dtcg)
|
||||||
(clj->js)
|
(clj->js)
|
||||||
(js/JSON.stringify nil 2)
|
(js/JSON.stringify nil 2))]
|
||||||
(wapi/create-blob "application/json"))]
|
(->> (wapi/create-blob (or tokens-json "{}") "application/json")
|
||||||
(dom/trigger-download "tokens.json" tokens-blob)))]
|
(dom/trigger-download "tokens.json"))))]
|
||||||
|
|
||||||
[:div {:class (stl/css :import-export-button-wrapper)}
|
[:div {:class (stl/css :import-export-button-wrapper)}
|
||||||
[:input {:type "file"
|
[:input {:type "file"
|
||||||
|
|
Loading…
Add table
Reference in a new issue