fix(editor): don't update block if there's no changes except the timestamps

This commit is contained in:
Tienson Qin
2020-12-29 21:28:25 +08:00
parent bdd48fb3e8
commit 54da887557
3 changed files with 18 additions and 8 deletions

View File

@@ -458,10 +458,8 @@
(medley/remove-keys (fn [k] (contains? (set remove-properties) k)) properties)
properties)
value (text/re-construct-block-properties value properties)
content-changed? (if auto-save?
(not= (text/remove-properties! (string/trim content))
(text/remove-properties! (string/trim value)))
(not= (string/trim content) (string/trim value)))]
content-changed? (not= (text/remove-timestamp-property! (string/trim content))
(text/remove-timestamp-property! (string/trim value)))]
(cond
content-changed?
(let [file (db/entity repo (:db/id file))]
@@ -2065,4 +2063,3 @@
(defn periodically-save!
[]
(js/setInterval save-current-block-when-idle! 3000))