fix: chokidar returns wrong "add" type when it's "change"

pull/1547/head
Tienson Qin 2021-03-27 22:57:53 +08:00
parent 9e4892690d
commit d2c070eac5
1 changed files with 3 additions and 2 deletions

View File

@ -29,8 +29,9 @@
;; 4. old content will overwrites the new content in step 2 ;; 4. old content will overwrites the new content in step 2
(not (and db-content (not (and db-content
(string/starts-with? db-content content)))) (string/starts-with? db-content content))))
(file-handler/alter-file repo path content {:re-render-root? true (let [_ (file-handler/alter-file repo path content {:re-render-root? true
:from-disk? true}))) :from-disk? true})]
(db/set-file-last-modified-at! repo path mtime))))
(and (= "change" type) (and (= "change" type)
(nil? (db/get-file path))) (nil? (db/get-file path)))