Browse Source

fix: local config doesn't work if it's not started

Gabriel Horner 2 years ago
parent
commit
fc03842150

+ 1 - 0
src/main/frontend/components/settings.cljs

@@ -1011,6 +1011,7 @@
      (flashcards-switcher-row enable-flashcards?)
      (zotero-settings-row)
      (when (config/db-based-graph? current-repo)
+       ;; FIXME: Wire this up again to RTC init calls
        (rtc-switcher-row (state/enable-rtc? current-repo)))
      (when-not web-platform?
        [:div.mt-1.sm:mt-0.sm:col-span-2

+ 2 - 0
src/main/frontend/handler.cljs

@@ -27,6 +27,7 @@
             [frontend.handler.page :as page-handler]
             [frontend.handler.plugin-config :as plugin-config-handler]
             [frontend.handler.repo :as repo-handler]
+            [frontend.handler.repo-config :as repo-config-handler]
             [frontend.handler.ui :as ui-handler]
             [frontend.handler.user :as user-handler]
             [frontend.idb :as idb]
@@ -87,6 +88,7 @@
   (when-let [repo (or (state/get-current-repo) (:url (first repos)))]
     (-> (p/do!
          (db-restore/restore-graph! repo)
+         (repo-config-handler/start {:repo repo})
          (op-mem-layer/<init-load-from-indexeddb! repo))
         (p/then
          (fn []

+ 6 - 7
src/main/frontend/handler/repo_config.cljs

@@ -57,10 +57,9 @@
   ([repo-url config-content]
    (set-repo-config-state! repo-url config-content)))
 
-;; comment this fn out to make linter happy
-;; (defn start
-;;   "This component only has one responsibility on start, to manage db and ui state
-;;   from repo config. It does not manage the repo directory, logseq/, as that is
-;;   loosely done by repo-handler"
-;;   [{:keys [repo]}]
-;;   (restore-repo-config! repo))
+(defn start
+  "This component only has one responsibility on start, to manage db and ui state
+  from repo config. It does not manage the repo directory, logseq/, as that is
+  loosely done by repo-handler"
+  [{:keys [repo]}]
+  (restore-repo-config! repo))