don't reload app after importing zip

This commit is contained in:
Tienson Qin
2026-02-01 17:29:04 +08:00
parent 6759c4c206
commit 276c66f0de
2 changed files with 9 additions and 6 deletions

View File

@@ -66,12 +66,15 @@
[".md" ".markdown" ".org" ".js" ".edn" ".css"]))))))))
(defn- finished-cb
[]
[& {:keys [reload?]
:or {reload? true}}]
(notification/show! "Import finished!" :success)
(shui/dialog-close! :import-indicator)
(route-handler/redirect-to-home!)
(if util/web-platform?
(js/window.location.reload)
(if reload?
(js/window.location.reload)
(js/setTimeout ui-handler/re-render-root! 500))
(js/setTimeout ui-handler/re-render-root! 500)))
(defn- lsq-import-handler
@@ -110,7 +113,9 @@
(notification/show! "Please specify another name as another graph with this name already exists!" :error)
:else
(db-import-handler/import-from-sqlite-zip! file graph-name finished-cb)))
(db-import-handler/import-from-sqlite-zip! file graph-name
(fn []
(finished-cb false)))))
(or debug-transit? db-edn?)
(let [graph-name (string/trim graph-name)]

View File

@@ -170,9 +170,7 @@
:warning false))
(state/set-state! :graph/importing nil)
(state/set-state! :graph/importing-state nil)
(p/delay 2000)
;; (finished-ok-handler)
)))))))
(finished-ok-handler))))))))
(p/catch
(fn [e]
(js/console.error e)