mirror of https://github.com/logseq/logseq
fix: don't alert file already exists when creating new page
parent
bca87b2b81
commit
b6a9afc303
|
@ -682,11 +682,12 @@
|
|||
dir (util/get-repo-dir repo)]
|
||||
(p/let [exists? (fs/file-exists? dir file-path)]
|
||||
(if exists?
|
||||
(notification/show!
|
||||
[:p.content
|
||||
(util/format "File %s already exists!"
|
||||
file-path)]
|
||||
:error)
|
||||
(do (notification/show!
|
||||
[:p.content
|
||||
(util/format "File %s already exists!"
|
||||
file-path)]
|
||||
:error)
|
||||
(state/set-editor-op! nil))
|
||||
;; create the file
|
||||
(let [content (util/default-content-with-title format (or
|
||||
(:page/original-name page)
|
||||
|
@ -703,8 +704,9 @@
|
|||
;; Continue to edit the last block
|
||||
(let [blocks (db/get-page-blocks repo (:page/name page))
|
||||
last-block (last blocks)]
|
||||
(edit-last-block-for-new-page! last-block 0))))))
|
||||
(state/set-editor-op! nil))
|
||||
(edit-last-block-for-new-page! last-block 0))
|
||||
|
||||
(state/set-editor-op! nil))))))
|
||||
|
||||
file
|
||||
(let [file-path (:file/path file)
|
||||
|
|
Loading…
Reference in New Issue