mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
@@ -203,8 +203,11 @@
|
||||
file (.getFile file-handle)]
|
||||
(when file
|
||||
(nfs-saved-handler repo path file)))
|
||||
(notification/show! (str "The file " path " already exists, please save your changes and click the refresh button to reload it.")
|
||||
:warning)))
|
||||
(do
|
||||
(notification/show! (str "The file " path " already exists, please append the content if you need it.\n Unsaved content: \n" content)
|
||||
:warning
|
||||
false)
|
||||
(state/pub-event! [:file/alter repo path text]))))
|
||||
(println "Error: directory handle not exists: " handle-path)))
|
||||
(p/catch (fn [error]
|
||||
(println "Write local file failed: " {:path path})
|
||||
|
||||
@@ -521,6 +521,10 @@
|
||||
(when (= dir (config/get-repo-dir repo))
|
||||
(fs/watch-dir! dir)))
|
||||
|
||||
(defmethod handle :file/alter [[_ repo path content]]
|
||||
(p/let [_ (file-handler/alter-file repo path content {:from-disk? true})]
|
||||
(ui-handler/re-render-root!)))
|
||||
|
||||
(defn run!
|
||||
[]
|
||||
(let [chan (state/get-events-chan)]
|
||||
|
||||
Reference in New Issue
Block a user