mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 09:26:28 +00:00
chore: remove nfs support
Assets will be stored in IndexedDB through memory fs on web.
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
[frontend.common.thread-api :as thread-api :refer [def-thread-api]]
|
||||
[frontend.config :as config]
|
||||
[frontend.fs :as fs]
|
||||
[frontend.fs.nfs :as nfs]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.state :as state]
|
||||
[frontend.util :as util]
|
||||
@@ -187,21 +186,7 @@
|
||||
(config/db-based-graph? (state/get-current-repo)) ; memory fs
|
||||
(p/let [binary (fs/read-file repo-dir path {})
|
||||
blob (js/Blob. (array binary) (clj->js {:type "image"}))]
|
||||
(when blob (js/URL.createObjectURL blob)))
|
||||
|
||||
:else ;; nfs
|
||||
(let [handle-path (str "handle/" full-path)
|
||||
cached-url (get @*assets-url-cache (keyword handle-path))]
|
||||
(if cached-url
|
||||
(p/resolved cached-url)
|
||||
;; Loading File from handle cache
|
||||
;; Use await file handle, to ensure all handles are loaded.
|
||||
(p/let [handle (nfs/await-get-nfs-file-handle repo handle-path)
|
||||
file (and handle (.getFile handle))]
|
||||
(when file
|
||||
(p/let [url (js/URL.createObjectURL file)]
|
||||
(swap! *assets-url-cache assoc (keyword handle-path) url)
|
||||
url)))))))))
|
||||
(when blob (js/URL.createObjectURL blob)))))))
|
||||
|
||||
(defn- decode-digest
|
||||
[^js/Uint8Array digest]
|
||||
|
||||
Reference in New Issue
Block a user