mirror of
https://github.com/logseq/logseq.git
synced 2026-05-20 02:42:49 +00:00
fix: can't create files (assets/draws) on browser
Fixes LOG-2908
This commit is contained in:
@@ -51,11 +51,13 @@
|
||||
(let [fpath (path/url-to-path dir)]
|
||||
(-> (js/window.pfs.mkdir fpath)
|
||||
(p/catch (fn [error] (println "(memory-fs)Mkdir error: " error)))))))
|
||||
(mkdir-recur! [_this dir]
|
||||
(mkdir-recur! [this dir]
|
||||
;; FIXME: replace this with a recurisve implementation
|
||||
(when js/window.pfs
|
||||
(let [fpath (path/url-to-path dir)]
|
||||
(-> (js/window.pfs.mkdir fpath #js {:recursive true})
|
||||
(p/catch (fn [error] (println "(memory-fs)Mkdir-recur error: " error)))))))
|
||||
(p/let [dir' (path/url-to-path dir)
|
||||
parent (path/parent dir')
|
||||
_ (when parent (<ensure-dir! parent))]
|
||||
(protocol/mkdir! this dir'))))
|
||||
|
||||
(readdir [_this dir]
|
||||
(when js/window.pfs
|
||||
|
||||
@@ -1454,8 +1454,8 @@
|
||||
|
||||
(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)))
|
||||
blob (js/Blob. (array binary) (clj->js {:type "image"}))]
|
||||
(when blob (js/URL.createObjectURL blob)))
|
||||
|
||||
:else ;; nfs
|
||||
(let [handle-path (str "handle/" full-path)
|
||||
|
||||
Reference in New Issue
Block a user