Просмотр исходного кода

chore: comment out electron? feature gate

Andelf 2 лет назад
Родитель
Сommit
f1d763aa12

+ 4 - 5
deps/db/src/logseq/db/sqlite/db.cljs

@@ -6,7 +6,6 @@
             [cljs-bean.core :as bean]
             [datascript.storage :refer [IStorage]]
             [cognitect.transit :as t]
-            [cljs-bean.core :as bean]
             [cljs.cache :as cache]
             [datascript.core :as d]
             [goog.object :as gobj]
@@ -91,10 +90,10 @@
   [repo addr]
   (when addr
     (when-let [db (get-db repo)]
-     (-> (query repo db
-                (str "select content from kvs where addr = " addr))
-         first
-         (gobj/get "content")))))
+      (-> (query repo db
+                 (str "select content from kvs where addr = " addr))
+          first
+          (gobj/get "content")))))
 
 (defn sqlite-storage
   [repo {:keys [threshold]

+ 3 - 3
src/main/frontend/db/restore.cljs

@@ -124,10 +124,10 @@
           data (persist-db/<fetch-init-data repo)
           electron? (util/electron?)
           {:keys [conn uuid->db-id-map journal-blocks datoms-count]}
-          (when-not electron? (sqlite-restore/restore-initial-data data {:conn-from-datoms-fn
+          (comment electron? (sqlite-restore/restore-initial-data data {:conn-from-datoms-fn
                                                                          (fn profiled-d-conn [& args]
                                                                            (util/profile :restore-graph-from-sqlite!-init-db (apply d/conn-from-datoms args)))}))
-          [conn datoms-count] (if electron?
+          [conn datoms-count] (if true
                                 (do
                                   (assert (some? data) "No data found when reloading db")
                                   (let [datoms (dt/read-transit-str data)]
@@ -143,7 +143,7 @@
     ;; TODO: Store schema in sqlite
     ;; (db-migrate/migrate attached-db)
 
-    (when-not electron?
+    (comment when-not electron?
       (js/setTimeout
        (fn []
          (p/let [other-data (persist-db/<fetch-blocks-excluding repo (map :uuid journal-blocks))

+ 1 - 1
src/main/frontend/persist_db/browser.cljs

@@ -139,7 +139,7 @@
     (-> (p/let [^js sqlite (ensure-sqlite-init)
                 ;; <fetch-initital-data is called when init/re-loading graph
                 ;; the underlying DB should be opened
-                _ (.openDB sqlite repo)]
+                _ (.newDB sqlite repo)]
           (.getInitialData sqlite repo))
         (p/catch (fn [error]
                    (prn ::fuck-error)

+ 1 - 1
src/main/frontend/persist_db/node.cljs

@@ -15,7 +15,7 @@
     (js/console.warn "TODO: list-db for electron is not implemented")
     [])
   (<unsafe-delete [_this _repo]
-    (js/console.warn "TODO: delete")
+    (js/console.warn "TODO: delete persidt-db on electron")
     (p/resolved nil))
   (<transact-data [_this repo tx-data tx-meta]
     (p->c