mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 18:36:43 +00:00
fix: incorrect asset path when create new page that local file not existed #1973
This commit is contained in:
@@ -1394,11 +1394,17 @@
|
||||
;; assets/journals_2021_02_03_1612350230540_0.png
|
||||
(defn resolve-relative-path
|
||||
[file-path]
|
||||
(if-let [current-file (some-> (state/get-edit-block)
|
||||
:block/file
|
||||
:db/id
|
||||
(db/entity)
|
||||
:file/path)]
|
||||
(if-let [current-file (or (some-> (state/get-edit-block)
|
||||
:block/file
|
||||
:db/id
|
||||
(db/entity)
|
||||
:file/path)
|
||||
|
||||
;; fix dummy file path of page
|
||||
(and (util/electron?)
|
||||
(util/node-path.join
|
||||
(config/get-repo-dir (state/get-current-repo))
|
||||
(config/get-pages-directory) "_.md")))]
|
||||
(util/get-relative-path current-file file-path)
|
||||
file-path))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user