add export+import support for files

This commit is contained in:
Gabriel Horner
2025-03-04 13:32:54 -05:00
parent e896641f6e
commit a7b586b2b0
3 changed files with 39 additions and 9 deletions

View File

@@ -70,7 +70,7 @@
(notification/show! "No block found" :warning)))]
(if (= ::invalid-import export-map)
(notification/show! "The submitted EDN data is invalid! Fix and try again." :warning)
(let [{:keys [init-tx block-props-tx error] :as txs}
(let [{:keys [init-tx block-props-tx misc-tx error] :as txs}
(try
(sqlite-export/build-import export-map
(db/get-db)
@@ -89,6 +89,9 @@
(when (seq block-props-tx)
(db/transact! (state/get-current-repo) block-props-tx
(if import-block? {:save-block true} {::sqlite-export/imported-data? true})))
(when (seq misc-tx)
(db/transact! (state/get-current-repo) misc-tx
(if import-block? {:save-block true} {::sqlite-export/imported-data? true})))
(when-not import-block?
(state/clear-async-query-state!)