mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 10:26:35 +00:00
fix: the file has been modified...
This commit is contained in:
@@ -20,18 +20,10 @@
|
||||
(when (and content (not (encrypt/content-encrypted? content)))
|
||||
(cond
|
||||
(= "add" type)
|
||||
(let [db-content (db/get-file path)]
|
||||
(when (and (not= content db-content)
|
||||
;; Avoid file overwrites
|
||||
;; 1. create a new page which writes a new file
|
||||
;; 2. add some new content
|
||||
;; 3. file watcher notified it with the old content
|
||||
;; 4. old content will overwrites the new content in step 2
|
||||
(not (and db-content
|
||||
(string/starts-with? db-content content))))
|
||||
(when-not (db/file-exists? repo path)
|
||||
(let [_ (file-handler/alter-file repo path content {:re-render-root? true
|
||||
:from-disk? true})]
|
||||
(db/set-file-last-modified-at! repo path mtime))))
|
||||
:from-disk? true})]
|
||||
(db/set-file-last-modified-at! repo path mtime)))
|
||||
|
||||
(and (= "change" type)
|
||||
(nil? (db/get-file path)))
|
||||
|
||||
Reference in New Issue
Block a user