mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
fix: don't write to files when db transaction failed
This commit is contained in:
@@ -2017,16 +2017,14 @@
|
||||
file-content (db/get-file file-path)
|
||||
new-content (utf8/insert! file-content start-pos old-end-pos (apply str (map :block/content blocks)))
|
||||
blocks (map (fn [b] (dissoc b :block/children)) blocks)]
|
||||
(profile
|
||||
"Indent/outdent: "
|
||||
(repo-handler/transact-react-and-alter-file!
|
||||
repo
|
||||
(concat
|
||||
blocks
|
||||
after-blocks)
|
||||
{:key :block/change
|
||||
:data (map (fn [block] (assoc block :block/page page)) blocks)}
|
||||
[[file-path new-content]])))
|
||||
(repo-handler/transact-react-and-alter-file!
|
||||
repo
|
||||
(concat
|
||||
blocks
|
||||
after-blocks)
|
||||
{:key :block/change
|
||||
:data (map (fn [block] (assoc block :block/page page)) blocks)}
|
||||
[[file-path new-content]]))
|
||||
|
||||
(gdom/getElement "date-time-picker")
|
||||
nil
|
||||
|
||||
Reference in New Issue
Block a user