diff --git a/src/main/frontend/components/imports.cljs b/src/main/frontend/components/imports.cljs index 3f9206e416..99e9bce98b 100644 --- a/src/main/frontend/components/imports.cljs +++ b/src/main/frontend/components/imports.cljs @@ -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)] diff --git a/src/main/frontend/handler/db_based/import.cljs b/src/main/frontend/handler/db_based/import.cljs index f34790e3f1..0a60a0ce39 100644 --- a/src/main/frontend/handler/db_based/import.cljs +++ b/src/main/frontend/handler/db_based/import.cljs @@ -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)