mirror of https://github.com/logseq/logseq
fix: use comlink with promesa
parent
e2ea7d7c29
commit
c14b2b4140
|
@ -102,10 +102,10 @@
|
|||
"@logseq/diff-merge": "0.2.2",
|
||||
"@logseq/react-tweet-embed": "1.3.1-1",
|
||||
"@logseq/sqlite": "=0.1.7",
|
||||
"@logseq/sqlite-wasm": "=0.0.3",
|
||||
"@radix-ui/colors": "^0.1.8",
|
||||
"@sentry/react": "^6.18.2",
|
||||
"@sentry/tracing": "^6.18.2",
|
||||
"@logseq/sqlite-wasm": "=0.0.3",
|
||||
"@tabler/icons": "^1.96.0",
|
||||
"@tippyjs/react": "4.2.5",
|
||||
"bignumber.js": "^9.0.2",
|
||||
|
|
|
@ -18,13 +18,12 @@
|
|||
(defn- init-sqlite-module!
|
||||
[]
|
||||
(when-not @*sqlite
|
||||
(let [base-url (str js/self.location.protocol "//" js/self.location.host)
|
||||
sqlite-wasm-url (str base-url "/js/")]
|
||||
(sqlite3InitModule (clj->js {:url sqlite-wasm-url
|
||||
(p/let [base-url (str js/self.location.protocol "//" js/self.location.host)
|
||||
sqlite-wasm-url (str base-url "/js/")
|
||||
sqlite (sqlite3InitModule (clj->js {:url sqlite-wasm-url
|
||||
:print js/console.log
|
||||
:printErr js/console.error})
|
||||
(fn [sqlite]
|
||||
(reset! *sqlite sqlite))))))
|
||||
:printErr js/console.error}))]
|
||||
(reset! *sqlite sqlite))))
|
||||
|
||||
(defn- close-all-dbs!
|
||||
[]
|
||||
|
@ -143,4 +142,5 @@
|
|||
"web worker entry"
|
||||
[]
|
||||
(let [^js obj (SQLiteDB.)]
|
||||
(Comlink/expose obj)))
|
||||
(p/let [_ (init-sqlite-module!)]
|
||||
(Comlink/expose obj))))
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
"js/db-worker.js"
|
||||
"/static/js/db-worker.js")
|
||||
worker (js/Worker. worker-url)
|
||||
^js sqlite (Comlink/wrap worker)]
|
||||
(reset! *sqlite sqlite)
|
||||
;; (.init sqlite)
|
||||
)))
|
||||
sqlite (Comlink/wrap worker)]
|
||||
(reset! *sqlite sqlite))))
|
||||
|
||||
(defrecord InBrowser []
|
||||
protocol/PersistentDB
|
||||
|
|
Loading…
Reference in New Issue