Browse Source

enhance(capacitor): switch graphs

charlie 6 months ago
parent
commit
0e71cd9f2f
2 changed files with 4 additions and 5 deletions
  1. 2 4
      src/main/capacitor/events.cljs
  2. 2 1
      src/main/frontend/handler/repo.cljs

+ 2 - 4
src/main/capacitor/events.cljs

@@ -47,10 +47,8 @@
   "graph: the target graph to switch to"
   [graph opts]
   (p/do!
-    (repo-handler/restore-and-setup-repo! graph)
-    ;(graph-switch graph)
-    (state/set-current-repo! graph)
-    (state/set-state! :sync-graph/init? false)))
+    (repo-handler/restore-and-setup-repo! graph {:ignore-style? true})
+    (state/set-current-repo! graph)))
 
 (defmethod handle :graph/switch [[_ graph opts]]
   (state/set-state! :db/async-queries {})

+ 2 - 1
src/main/frontend/handler/repo.cljs

@@ -76,7 +76,8 @@
    (when (config/global-config-enabled?)
      (global-config-handler/restore-global-config!))
     ;; Don't have to unlisten the old listener, as it will be destroyed with the conn
-   (ui-handler/add-style-if-exists!)
+   (when-not (true? (:ignore-style? opts))
+     (ui-handler/add-style-if-exists!))
    (when-not config/publishing?
      (state/set-db-restoring! false))))