mirror of https://github.com/logseq/logseq
chore: disable last-modified-at check when writing temporally
parent
dc6acbab6c
commit
fafce3f69f
|
@ -137,23 +137,26 @@
|
||||||
(p/let [_ (verify-permission repo file-handle true)
|
(p/let [_ (verify-permission repo file-handle true)
|
||||||
_ (utils/writeFile file-handle content)
|
_ (utils/writeFile file-handle content)
|
||||||
file (.getFile file-handle)]
|
file (.getFile file-handle)]
|
||||||
(if (and local-content new?
|
(p/let [_ (verify-permission repo file-handle true)
|
||||||
(or
|
_ (utils/writeFile file-handle content)
|
||||||
draw?
|
file (.getFile file-handle)]
|
||||||
;; Writing not finished
|
(when file
|
||||||
(> pending-writes 0)
|
(nfs-saved-handler repo path file)))
|
||||||
;; not changed by other editors
|
;; (if (and local-content new?
|
||||||
not-changed?
|
;; (or
|
||||||
new-created?))
|
;; draw?
|
||||||
(do
|
;; ;; Writing not finished
|
||||||
(p/let [_ (verify-permission repo file-handle true)
|
;; (> pending-writes 0)
|
||||||
_ (utils/writeFile file-handle content)
|
;; ;; not changed by other editors
|
||||||
file (.getFile file-handle)]
|
;; not-changed?
|
||||||
(when file
|
;; new-created?))
|
||||||
(nfs-saved-handler repo path file))))
|
;; (p/let [_ (verify-permission repo file-handle true)
|
||||||
(do
|
;; _ (utils/writeFile file-handle content)
|
||||||
(js/alert (str "The file has been modified on your local disk! File path: " path
|
;; file (.getFile file-handle)]
|
||||||
", please save your changes and click the refresh button to reload it."))))
|
;; (when file
|
||||||
|
;; (nfs-saved-handler repo path file)))
|
||||||
|
;; (js/alert (str "The file has been modified on your local disk! File path: " path
|
||||||
|
;; ", please save your changes and click the refresh button to reload it.")))
|
||||||
))
|
))
|
||||||
;; create file handle
|
;; create file handle
|
||||||
(->
|
(->
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
[repo dir path content {:keys [ok-handler error-handler] :as opts} stat]
|
[repo dir path content {:keys [ok-handler error-handler] :as opts} stat]
|
||||||
(p/let [disk-mtime (when stat (gobj/get stat "mtime"))
|
(p/let [disk-mtime (when stat (gobj/get stat "mtime"))
|
||||||
db-mtime (db/get-file-last-modified-at repo path)]
|
db-mtime (db/get-file-last-modified-at repo path)]
|
||||||
(if (not= disk-mtime db-mtime)
|
(if
|
||||||
|
false
|
||||||
|
;; (not= disk-mtime db-mtime)
|
||||||
(js/alert (str "The file has been modified on your local disk! File path: " path
|
(js/alert (str "The file has been modified on your local disk! File path: " path
|
||||||
", please save your changes and click the refresh button to reload it."))
|
", please save your changes and click the refresh button to reload it."))
|
||||||
(->
|
(->
|
||||||
|
|
Loading…
Reference in New Issue