Browse Source

fix: browser tab opens after import

in electron. Follow up fix for
https://test.logseq.com/#/page/6812486a-77a8-4bbf-b9a9-7dfe94f94a00
Gabriel Horner 7 months ago
parent
commit
4c8e35a02a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/main/frontend/components/imports.cljs

+ 4 - 1
src/main/frontend/components/imports.cljs

@@ -17,6 +17,7 @@
             [frontend.handler.notification :as notification]
             [frontend.handler.repo :as repo-handler]
             [frontend.handler.route :as route-handler]
+            [frontend.handler.ui :as ui-handler]
             [frontend.persist-db.browser :as db-browser]
             [frontend.state :as state]
             [frontend.ui :as ui]
@@ -45,7 +46,9 @@
   (notification/show! "Import finished!" :success)
   (shui/dialog-close! :import-indicator)
   (route-handler/redirect-to-home!)
-  (js/window.location.reload))
+  (if util/web-platform?
+    (js/window.location.reload)
+    (js/setTimeout ui-handler/re-render-root! 500)))
 
 (defn- roam-import-handler
   [e]