mirror of https://github.com/logseq/logseq
chore: comment out electron? feature gate
parent
ca24545b53
commit
f1d763aa12
|
@ -6,7 +6,6 @@
|
||||||
[cljs-bean.core :as bean]
|
[cljs-bean.core :as bean]
|
||||||
[datascript.storage :refer [IStorage]]
|
[datascript.storage :refer [IStorage]]
|
||||||
[cognitect.transit :as t]
|
[cognitect.transit :as t]
|
||||||
[cljs-bean.core :as bean]
|
|
||||||
[cljs.cache :as cache]
|
[cljs.cache :as cache]
|
||||||
[datascript.core :as d]
|
[datascript.core :as d]
|
||||||
[goog.object :as gobj]
|
[goog.object :as gobj]
|
||||||
|
@ -91,10 +90,10 @@
|
||||||
[repo addr]
|
[repo addr]
|
||||||
(when addr
|
(when addr
|
||||||
(when-let [db (get-db repo)]
|
(when-let [db (get-db repo)]
|
||||||
(-> (query repo db
|
(-> (query repo db
|
||||||
(str "select content from kvs where addr = " addr))
|
(str "select content from kvs where addr = " addr))
|
||||||
first
|
first
|
||||||
(gobj/get "content")))))
|
(gobj/get "content")))))
|
||||||
|
|
||||||
(defn sqlite-storage
|
(defn sqlite-storage
|
||||||
[repo {:keys [threshold]
|
[repo {:keys [threshold]
|
||||||
|
|
|
@ -124,10 +124,10 @@
|
||||||
data (persist-db/<fetch-init-data repo)
|
data (persist-db/<fetch-init-data repo)
|
||||||
electron? (util/electron?)
|
electron? (util/electron?)
|
||||||
{:keys [conn uuid->db-id-map journal-blocks datoms-count]}
|
{: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]
|
(fn profiled-d-conn [& args]
|
||||||
(util/profile :restore-graph-from-sqlite!-init-db (apply d/conn-from-datoms 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
|
(do
|
||||||
(assert (some? data) "No data found when reloading db")
|
(assert (some? data) "No data found when reloading db")
|
||||||
(let [datoms (dt/read-transit-str data)]
|
(let [datoms (dt/read-transit-str data)]
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
;; TODO: Store schema in sqlite
|
;; TODO: Store schema in sqlite
|
||||||
;; (db-migrate/migrate attached-db)
|
;; (db-migrate/migrate attached-db)
|
||||||
|
|
||||||
(when-not electron?
|
(comment when-not electron?
|
||||||
(js/setTimeout
|
(js/setTimeout
|
||||||
(fn []
|
(fn []
|
||||||
(p/let [other-data (persist-db/<fetch-blocks-excluding repo (map :uuid journal-blocks))
|
(p/let [other-data (persist-db/<fetch-blocks-excluding repo (map :uuid journal-blocks))
|
||||||
|
|
|
@ -139,7 +139,7 @@
|
||||||
(-> (p/let [^js sqlite (ensure-sqlite-init)
|
(-> (p/let [^js sqlite (ensure-sqlite-init)
|
||||||
;; <fetch-initital-data is called when init/re-loading graph
|
;; <fetch-initital-data is called when init/re-loading graph
|
||||||
;; the underlying DB should be opened
|
;; the underlying DB should be opened
|
||||||
_ (.openDB sqlite repo)]
|
_ (.newDB sqlite repo)]
|
||||||
(.getInitialData sqlite repo))
|
(.getInitialData sqlite repo))
|
||||||
(p/catch (fn [error]
|
(p/catch (fn [error]
|
||||||
(prn ::fuck-error)
|
(prn ::fuck-error)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
(js/console.warn "TODO: list-db for electron is not implemented")
|
(js/console.warn "TODO: list-db for electron is not implemented")
|
||||||
[])
|
[])
|
||||||
(<unsafe-delete [_this _repo]
|
(<unsafe-delete [_this _repo]
|
||||||
(js/console.warn "TODO: delete")
|
(js/console.warn "TODO: delete persidt-db on electron")
|
||||||
(p/resolved nil))
|
(p/resolved nil))
|
||||||
(<transact-data [_this repo tx-data tx-meta]
|
(<transact-data [_this repo tx-data tx-meta]
|
||||||
(p->c
|
(p->c
|
||||||
|
|
Loading…
Reference in New Issue