Explorar el Código

fix: don't export db when switching from a file-based graph

Tienson Qin hace 2 años
padre
commit
f6dced699d
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      src/main/frontend/persist_db.cljs

+ 5 - 2
src/main/frontend/persist_db.cljs

@@ -4,7 +4,8 @@
              [frontend.persist-db.protocol :as protocol]
              [promesa.core :as p]
              [frontend.state :as state]
-             [frontend.util :as util]))
+             [frontend.util :as util]
+             [frontend.config :as config]))
 
 (defonce opfs-db (browser/->InBrowser))
 
@@ -44,7 +45,9 @@
   {:pre [(<= (count repo) 56)]}
   (p/do!
    (let [current-repo (state/get-current-repo)]
-     (when (and (util/electron?) (not= repo current-repo))
+     (when (and (util/electron?)
+                (not= repo current-repo)
+                (config/db-based-graph? current-repo))
        ;; switch graph
        (<export-db current-repo {}))
      (protocol/<new (get-impl) repo))))